PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/tronweb/dist

Просмотр файла: TronWeb.node.js

module.exports=function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=41)}([function(t,e){t.exports=require("@babel/runtime/regenerator")},function(t,e){t.exports=require("@babel/runtime/helpers/asyncToGenerator")},function(t,e){t.exports=require("@babel/runtime/helpers/classCallCheck")},function(t,e){t.exports=require("@babel/runtime/helpers/createClass")},function(t,e){t.exports=require("@babel/runtime/helpers/defineProperty")},function(t,e){t.exports=require("ethers")},function(t,e){t.exports=require("@ethersproject/bytes")},function(t,e){t.exports=require("injectpromise")},function(t,e){t.exports=require("@tronweb3/google-protobuf")},function(t,e){t.exports=require("@babel/runtime/helpers/typeof")},function(t,e){t.exports=require("@babel/runtime/helpers/toConsumableArray")},function(t,e){t.exports=require("@ethersproject/bignumber")},function(t,e){t.exports=require("@babel/runtime/helpers/slicedToArray")},function(t,e){t.exports=require("@ethersproject/keccak256")},function(t,e){t.exports=require("bignumber.js")},function(t,e){t.exports=require("@babel/runtime/helpers/assertThisInitialized")},function(t,e){t.exports=require("@ethersproject/properties")},function(t,e){t.exports=require("semver")},function(t,e){t.exports=require("elliptic")},function(t,e){t.exports=require("@babel/runtime/helpers/getPrototypeOf")},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null),a=r(32);n.object.extend(proto,a),n.exportSymbol("proto.protocol.Account",null,s),n.exportSymbol("proto.protocol.Account.AccountResource",null,s),n.exportSymbol("proto.protocol.Account.Frozen",null,s),n.exportSymbol("proto.protocol.AccountId",null,s),n.exportSymbol("proto.protocol.AccountType",null,s),n.exportSymbol("proto.protocol.DelegatedResource",null,s),n.exportSymbol("proto.protocol.Exchange",null,s),n.exportSymbol("proto.protocol.Key",null,s),n.exportSymbol("proto.protocol.MarketOrderDetail",null,s),n.exportSymbol("proto.protocol.Permission",null,s),n.exportSymbol("proto.protocol.Permission.PermissionType",null,s),n.exportSymbol("proto.protocol.Proposal",null,s),n.exportSymbol("proto.protocol.Proposal.State",null,s),n.exportSymbol("proto.protocol.Transaction",null,s),n.exportSymbol("proto.protocol.Transaction.Contract",null,s),n.exportSymbol("proto.protocol.Transaction.Contract.ContractType",null,s),n.exportSymbol("proto.protocol.Transaction.Result",null,s),n.exportSymbol("proto.protocol.Transaction.Result.code",null,s),n.exportSymbol("proto.protocol.Transaction.Result.contractResult",null,s),n.exportSymbol("proto.protocol.Transaction.raw",null,s),n.exportSymbol("proto.protocol.Vote",null,s),n.exportSymbol("proto.protocol.Votes",null,s),n.exportSymbol("proto.protocol.Witness",null,s),n.exportSymbol("proto.protocol.authority",null,s),proto.protocol.AccountId=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.AccountId,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AccountId.displayName="proto.protocol.AccountId"),proto.protocol.Vote=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.Vote,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Vote.displayName="proto.protocol.Vote"),proto.protocol.Proposal=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.Proposal.repeatedFields_,null)},n.inherits(proto.protocol.Proposal,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Proposal.displayName="proto.protocol.Proposal"),proto.protocol.Exchange=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.Exchange,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Exchange.displayName="proto.protocol.Exchange"),proto.protocol.Account=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.Account.repeatedFields_,null)},n.inherits(proto.protocol.Account,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Account.displayName="proto.protocol.Account"),proto.protocol.Account.Frozen=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.Account.Frozen,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Account.Frozen.displayName="proto.protocol.Account.Frozen"),proto.protocol.Account.AccountResource=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.Account.AccountResource,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Account.AccountResource.displayName="proto.protocol.Account.AccountResource"),proto.protocol.Key=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.Key,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Key.displayName="proto.protocol.Key"),proto.protocol.DelegatedResource=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.DelegatedResource,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.DelegatedResource.displayName="proto.protocol.DelegatedResource"),proto.protocol.authority=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.authority,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.authority.displayName="proto.protocol.authority"),proto.protocol.Permission=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.Permission.repeatedFields_,null)},n.inherits(proto.protocol.Permission,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Permission.displayName="proto.protocol.Permission"),proto.protocol.Witness=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.Witness,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Witness.displayName="proto.protocol.Witness"),proto.protocol.Votes=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.Votes.repeatedFields_,null)},n.inherits(proto.protocol.Votes,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Votes.displayName="proto.protocol.Votes"),proto.protocol.MarketOrderDetail=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.MarketOrderDetail,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.MarketOrderDetail.displayName="proto.protocol.MarketOrderDetail"),proto.protocol.Transaction=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.Transaction.repeatedFields_,null)},n.inherits(proto.protocol.Transaction,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Transaction.displayName="proto.protocol.Transaction"),proto.protocol.Transaction.Contract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.Transaction.Contract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Transaction.Contract.displayName="proto.protocol.Transaction.Contract"),proto.protocol.Transaction.Result=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.Transaction.Result.repeatedFields_,null)},n.inherits(proto.protocol.Transaction.Result,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Transaction.Result.displayName="proto.protocol.Transaction.Result"),proto.protocol.Transaction.raw=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.Transaction.raw.repeatedFields_,null)},n.inherits(proto.protocol.Transaction.raw,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.Transaction.raw.displayName="proto.protocol.Transaction.raw"),o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AccountId.prototype.toObject=function(t){return proto.protocol.AccountId.toObject(t,this)},proto.protocol.AccountId.toObject=function(t,e){var r={name:e.getName_asB64(),address:e.getAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.AccountId.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AccountId;return proto.protocol.AccountId.deserializeBinaryFromReader(r,e)},proto.protocol.AccountId.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setName(r);break;case 2:r=e.readBytes();t.setAddress(r);break;default:e.skipField()}}return t},proto.protocol.AccountId.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AccountId.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AccountId.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getName_asU8()).length>0&&e.writeBytes(1,r),(r=t.getAddress_asU8()).length>0&&e.writeBytes(2,r)},proto.protocol.AccountId.prototype.getName=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.AccountId.prototype.getName_asB64=function(){return o.Message.bytesAsB64(this.getName())},proto.protocol.AccountId.prototype.getName_asU8=function(){return o.Message.bytesAsU8(this.getName())},proto.protocol.AccountId.prototype.setName=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.AccountId.prototype.getAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.AccountId.prototype.getAddress_asB64=function(){return o.Message.bytesAsB64(this.getAddress())},proto.protocol.AccountId.prototype.getAddress_asU8=function(){return o.Message.bytesAsU8(this.getAddress())},proto.protocol.AccountId.prototype.setAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Vote.prototype.toObject=function(t){return proto.protocol.Vote.toObject(t,this)},proto.protocol.Vote.toObject=function(t,e){var r={voteAddress:e.getVoteAddress_asB64(),voteCount:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Vote.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Vote;return proto.protocol.Vote.deserializeBinaryFromReader(r,e)},proto.protocol.Vote.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setVoteAddress(r);break;case 2:r=e.readInt64();t.setVoteCount(r);break;default:e.skipField()}}return t},proto.protocol.Vote.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Vote.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Vote.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getVoteAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getVoteCount())&&e.writeInt64(2,r)},proto.protocol.Vote.prototype.getVoteAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.Vote.prototype.getVoteAddress_asB64=function(){return o.Message.bytesAsB64(this.getVoteAddress())},proto.protocol.Vote.prototype.getVoteAddress_asU8=function(){return o.Message.bytesAsU8(this.getVoteAddress())},proto.protocol.Vote.prototype.setVoteAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.Vote.prototype.getVoteCount=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.Vote.prototype.setVoteCount=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.Proposal.repeatedFields_=[6],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Proposal.prototype.toObject=function(t){return proto.protocol.Proposal.toObject(t,this)},proto.protocol.Proposal.toObject=function(t,e){var r,n={proposalId:o.Message.getFieldWithDefault(e,1,0),proposerAddress:e.getProposerAddress_asB64(),parametersMap:(r=e.getParametersMap())?r.toObject(t,void 0):[],expirationTime:o.Message.getFieldWithDefault(e,4,0),createTime:o.Message.getFieldWithDefault(e,5,0),approvalsList:e.getApprovalsList_asB64(),state:o.Message.getFieldWithDefault(e,7,0)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.Proposal.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Proposal;return proto.protocol.Proposal.deserializeBinaryFromReader(r,e)},proto.protocol.Proposal.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setProposalId(r);break;case 2:r=e.readBytes();t.setProposerAddress(r);break;case 3:r=t.getParametersMap();e.readMessage(r,(function(t,e){o.Map.deserializeBinary(t,e,o.BinaryReader.prototype.readInt64,o.BinaryReader.prototype.readInt64,null,0,0)}));break;case 4:r=e.readInt64();t.setExpirationTime(r);break;case 5:r=e.readInt64();t.setCreateTime(r);break;case 6:r=e.readBytes();t.addApprovals(r);break;case 7:r=e.readEnum();t.setState(r);break;default:e.skipField()}}return t},proto.protocol.Proposal.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Proposal.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Proposal.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getProposalId())&&e.writeInt64(1,r),(r=t.getProposerAddress_asU8()).length>0&&e.writeBytes(2,r),(r=t.getParametersMap(!0))&&r.getLength()>0&&r.serializeBinary(3,e,o.BinaryWriter.prototype.writeInt64,o.BinaryWriter.prototype.writeInt64),0!==(r=t.getExpirationTime())&&e.writeInt64(4,r),0!==(r=t.getCreateTime())&&e.writeInt64(5,r),(r=t.getApprovalsList_asU8()).length>0&&e.writeRepeatedBytes(6,r),0!==(r=t.getState())&&e.writeEnum(7,r)},proto.protocol.Proposal.State={PENDING:0,DISAPPROVED:1,APPROVED:2,CANCELED:3},proto.protocol.Proposal.prototype.getProposalId=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.Proposal.prototype.setProposalId=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.Proposal.prototype.getProposerAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.Proposal.prototype.getProposerAddress_asB64=function(){return o.Message.bytesAsB64(this.getProposerAddress())},proto.protocol.Proposal.prototype.getProposerAddress_asU8=function(){return o.Message.bytesAsU8(this.getProposerAddress())},proto.protocol.Proposal.prototype.setProposerAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.Proposal.prototype.getParametersMap=function(t){return o.Message.getMapField(this,3,t,null)},proto.protocol.Proposal.prototype.clearParametersMap=function(){return this.getParametersMap().clear(),this},proto.protocol.Proposal.prototype.getExpirationTime=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.Proposal.prototype.setExpirationTime=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.Proposal.prototype.getCreateTime=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.Proposal.prototype.setCreateTime=function(t){return o.Message.setProto3IntField(this,5,t)},proto.protocol.Proposal.prototype.getApprovalsList=function(){return o.Message.getRepeatedField(this,6)},proto.protocol.Proposal.prototype.getApprovalsList_asB64=function(){return o.Message.bytesListAsB64(this.getApprovalsList())},proto.protocol.Proposal.prototype.getApprovalsList_asU8=function(){return o.Message.bytesListAsU8(this.getApprovalsList())},proto.protocol.Proposal.prototype.setApprovalsList=function(t){return o.Message.setField(this,6,t||[])},proto.protocol.Proposal.prototype.addApprovals=function(t,e){return o.Message.addToRepeatedField(this,6,t,e)},proto.protocol.Proposal.prototype.clearApprovalsList=function(){return this.setApprovalsList([])},proto.protocol.Proposal.prototype.getState=function(){return o.Message.getFieldWithDefault(this,7,0)},proto.protocol.Proposal.prototype.setState=function(t){return o.Message.setProto3EnumField(this,7,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Exchange.prototype.toObject=function(t){return proto.protocol.Exchange.toObject(t,this)},proto.protocol.Exchange.toObject=function(t,e){var r={exchangeId:o.Message.getFieldWithDefault(e,1,0),creatorAddress:e.getCreatorAddress_asB64(),createTime:o.Message.getFieldWithDefault(e,3,0),firstTokenId:e.getFirstTokenId_asB64(),firstTokenBalance:o.Message.getFieldWithDefault(e,7,0),secondTokenId:e.getSecondTokenId_asB64(),secondTokenBalance:o.Message.getFieldWithDefault(e,9,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Exchange.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Exchange;return proto.protocol.Exchange.deserializeBinaryFromReader(r,e)},proto.protocol.Exchange.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setExchangeId(r);break;case 2:r=e.readBytes();t.setCreatorAddress(r);break;case 3:r=e.readInt64();t.setCreateTime(r);break;case 6:r=e.readBytes();t.setFirstTokenId(r);break;case 7:r=e.readInt64();t.setFirstTokenBalance(r);break;case 8:r=e.readBytes();t.setSecondTokenId(r);break;case 9:r=e.readInt64();t.setSecondTokenBalance(r);break;default:e.skipField()}}return t},proto.protocol.Exchange.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Exchange.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Exchange.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getExchangeId())&&e.writeInt64(1,r),(r=t.getCreatorAddress_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getCreateTime())&&e.writeInt64(3,r),(r=t.getFirstTokenId_asU8()).length>0&&e.writeBytes(6,r),0!==(r=t.getFirstTokenBalance())&&e.writeInt64(7,r),(r=t.getSecondTokenId_asU8()).length>0&&e.writeBytes(8,r),0!==(r=t.getSecondTokenBalance())&&e.writeInt64(9,r)},proto.protocol.Exchange.prototype.getExchangeId=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.Exchange.prototype.setExchangeId=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.Exchange.prototype.getCreatorAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.Exchange.prototype.getCreatorAddress_asB64=function(){return o.Message.bytesAsB64(this.getCreatorAddress())},proto.protocol.Exchange.prototype.getCreatorAddress_asU8=function(){return o.Message.bytesAsU8(this.getCreatorAddress())},proto.protocol.Exchange.prototype.setCreatorAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.Exchange.prototype.getCreateTime=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.Exchange.prototype.setCreateTime=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.Exchange.prototype.getFirstTokenId=function(){return o.Message.getFieldWithDefault(this,6,"")},proto.protocol.Exchange.prototype.getFirstTokenId_asB64=function(){return o.Message.bytesAsB64(this.getFirstTokenId())},proto.protocol.Exchange.prototype.getFirstTokenId_asU8=function(){return o.Message.bytesAsU8(this.getFirstTokenId())},proto.protocol.Exchange.prototype.setFirstTokenId=function(t){return o.Message.setProto3BytesField(this,6,t)},proto.protocol.Exchange.prototype.getFirstTokenBalance=function(){return o.Message.getFieldWithDefault(this,7,0)},proto.protocol.Exchange.prototype.setFirstTokenBalance=function(t){return o.Message.setProto3IntField(this,7,t)},proto.protocol.Exchange.prototype.getSecondTokenId=function(){return o.Message.getFieldWithDefault(this,8,"")},proto.protocol.Exchange.prototype.getSecondTokenId_asB64=function(){return o.Message.bytesAsB64(this.getSecondTokenId())},proto.protocol.Exchange.prototype.getSecondTokenId_asU8=function(){return o.Message.bytesAsU8(this.getSecondTokenId())},proto.protocol.Exchange.prototype.setSecondTokenId=function(t){return o.Message.setProto3BytesField(this,8,t)},proto.protocol.Exchange.prototype.getSecondTokenBalance=function(){return o.Message.getFieldWithDefault(this,9,0)},proto.protocol.Exchange.prototype.setSecondTokenBalance=function(t){return o.Message.setProto3IntField(this,9,t)},proto.protocol.Account.repeatedFields_=[5,7,16,33],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Account.prototype.toObject=function(t){return proto.protocol.Account.toObject(t,this)},proto.protocol.Account.toObject=function(t,e){var r,n={accountName:e.getAccountName_asB64(),type:o.Message.getFieldWithDefault(e,2,0),address:e.getAddress_asB64(),balance:o.Message.getFieldWithDefault(e,4,0),votesList:o.Message.toObjectList(e.getVotesList(),proto.protocol.Vote.toObject,t),assetMap:(r=e.getAssetMap())?r.toObject(t,void 0):[],assetv2Map:(r=e.getAssetv2Map())?r.toObject(t,void 0):[],frozenList:o.Message.toObjectList(e.getFrozenList(),proto.protocol.Account.Frozen.toObject,t),netUsage:o.Message.getFieldWithDefault(e,8,0),acquiredDelegatedFrozenBalanceForBandwidth:o.Message.getFieldWithDefault(e,41,0),delegatedFrozenBalanceForBandwidth:o.Message.getFieldWithDefault(e,42,0),oldTronPower:o.Message.getFieldWithDefault(e,46,0),tronPower:(r=e.getTronPower())&&proto.protocol.Account.Frozen.toObject(t,r),assetOptimized:o.Message.getBooleanFieldWithDefault(e,60,!1),createTime:o.Message.getFieldWithDefault(e,9,0),latestOprationTime:o.Message.getFieldWithDefault(e,10,0),allowance:o.Message.getFieldWithDefault(e,11,0),latestWithdrawTime:o.Message.getFieldWithDefault(e,12,0),code:e.getCode_asB64(),isWitness:o.Message.getBooleanFieldWithDefault(e,14,!1),isCommittee:o.Message.getBooleanFieldWithDefault(e,15,!1),frozenSupplyList:o.Message.toObjectList(e.getFrozenSupplyList(),proto.protocol.Account.Frozen.toObject,t),assetIssuedName:e.getAssetIssuedName_asB64(),assetIssuedId:e.getAssetIssuedId_asB64(),latestAssetOperationTimeMap:(r=e.getLatestAssetOperationTimeMap())?r.toObject(t,void 0):[],latestAssetOperationTimev2Map:(r=e.getLatestAssetOperationTimev2Map())?r.toObject(t,void 0):[],freeNetUsage:o.Message.getFieldWithDefault(e,19,0),freeAssetNetUsageMap:(r=e.getFreeAssetNetUsageMap())?r.toObject(t,void 0):[],freeAssetNetUsagev2Map:(r=e.getFreeAssetNetUsagev2Map())?r.toObject(t,void 0):[],latestConsumeTime:o.Message.getFieldWithDefault(e,21,0),latestConsumeFreeTime:o.Message.getFieldWithDefault(e,22,0),accountId:e.getAccountId_asB64(),accountResource:(r=e.getAccountResource())&&proto.protocol.Account.AccountResource.toObject(t,r),codehash:e.getCodehash_asB64(),ownerPermission:(r=e.getOwnerPermission())&&proto.protocol.Permission.toObject(t,r),witnessPermission:(r=e.getWitnessPermission())&&proto.protocol.Permission.toObject(t,r),activePermissionList:o.Message.toObjectList(e.getActivePermissionList(),proto.protocol.Permission.toObject,t)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.Account.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Account;return proto.protocol.Account.deserializeBinaryFromReader(r,e)},proto.protocol.Account.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setAccountName(r);break;case 2:r=e.readEnum();t.setType(r);break;case 3:r=e.readBytes();t.setAddress(r);break;case 4:r=e.readInt64();t.setBalance(r);break;case 5:r=new proto.protocol.Vote;e.readMessage(r,proto.protocol.Vote.deserializeBinaryFromReader),t.addVotes(r);break;case 6:r=t.getAssetMap();e.readMessage(r,(function(t,e){o.Map.deserializeBinary(t,e,o.BinaryReader.prototype.readString,o.BinaryReader.prototype.readInt64,null,"",0)}));break;case 56:r=t.getAssetv2Map();e.readMessage(r,(function(t,e){o.Map.deserializeBinary(t,e,o.BinaryReader.prototype.readString,o.BinaryReader.prototype.readInt64,null,"",0)}));break;case 7:r=new proto.protocol.Account.Frozen;e.readMessage(r,proto.protocol.Account.Frozen.deserializeBinaryFromReader),t.addFrozen(r);break;case 8:r=e.readInt64();t.setNetUsage(r);break;case 41:r=e.readInt64();t.setAcquiredDelegatedFrozenBalanceForBandwidth(r);break;case 42:r=e.readInt64();t.setDelegatedFrozenBalanceForBandwidth(r);break;case 46:r=e.readInt64();t.setOldTronPower(r);break;case 47:r=new proto.protocol.Account.Frozen;e.readMessage(r,proto.protocol.Account.Frozen.deserializeBinaryFromReader),t.setTronPower(r);break;case 60:r=e.readBool();t.setAssetOptimized(r);break;case 9:r=e.readInt64();t.setCreateTime(r);break;case 10:r=e.readInt64();t.setLatestOprationTime(r);break;case 11:r=e.readInt64();t.setAllowance(r);break;case 12:r=e.readInt64();t.setLatestWithdrawTime(r);break;case 13:r=e.readBytes();t.setCode(r);break;case 14:r=e.readBool();t.setIsWitness(r);break;case 15:r=e.readBool();t.setIsCommittee(r);break;case 16:r=new proto.protocol.Account.Frozen;e.readMessage(r,proto.protocol.Account.Frozen.deserializeBinaryFromReader),t.addFrozenSupply(r);break;case 17:r=e.readBytes();t.setAssetIssuedName(r);break;case 57:r=e.readBytes();t.setAssetIssuedId(r);break;case 18:r=t.getLatestAssetOperationTimeMap();e.readMessage(r,(function(t,e){o.Map.deserializeBinary(t,e,o.BinaryReader.prototype.readString,o.BinaryReader.prototype.readInt64,null,"",0)}));break;case 58:r=t.getLatestAssetOperationTimev2Map();e.readMessage(r,(function(t,e){o.Map.deserializeBinary(t,e,o.BinaryReader.prototype.readString,o.BinaryReader.prototype.readInt64,null,"",0)}));break;case 19:r=e.readInt64();t.setFreeNetUsage(r);break;case 20:r=t.getFreeAssetNetUsageMap();e.readMessage(r,(function(t,e){o.Map.deserializeBinary(t,e,o.BinaryReader.prototype.readString,o.BinaryReader.prototype.readInt64,null,"",0)}));break;case 59:r=t.getFreeAssetNetUsagev2Map();e.readMessage(r,(function(t,e){o.Map.deserializeBinary(t,e,o.BinaryReader.prototype.readString,o.BinaryReader.prototype.readInt64,null,"",0)}));break;case 21:r=e.readInt64();t.setLatestConsumeTime(r);break;case 22:r=e.readInt64();t.setLatestConsumeFreeTime(r);break;case 23:r=e.readBytes();t.setAccountId(r);break;case 26:r=new proto.protocol.Account.AccountResource;e.readMessage(r,proto.protocol.Account.AccountResource.deserializeBinaryFromReader),t.setAccountResource(r);break;case 30:r=e.readBytes();t.setCodehash(r);break;case 31:r=new proto.protocol.Permission;e.readMessage(r,proto.protocol.Permission.deserializeBinaryFromReader),t.setOwnerPermission(r);break;case 32:r=new proto.protocol.Permission;e.readMessage(r,proto.protocol.Permission.deserializeBinaryFromReader),t.setWitnessPermission(r);break;case 33:r=new proto.protocol.Permission;e.readMessage(r,proto.protocol.Permission.deserializeBinaryFromReader),t.addActivePermission(r);break;default:e.skipField()}}return t},proto.protocol.Account.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Account.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Account.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getAccountName_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getType())&&e.writeEnum(2,r),(r=t.getAddress_asU8()).length>0&&e.writeBytes(3,r),0!==(r=t.getBalance())&&e.writeInt64(4,r),(r=t.getVotesList()).length>0&&e.writeRepeatedMessage(5,r,proto.protocol.Vote.serializeBinaryToWriter),(r=t.getAssetMap(!0))&&r.getLength()>0&&r.serializeBinary(6,e,o.BinaryWriter.prototype.writeString,o.BinaryWriter.prototype.writeInt64),(r=t.getAssetv2Map(!0))&&r.getLength()>0&&r.serializeBinary(56,e,o.BinaryWriter.prototype.writeString,o.BinaryWriter.prototype.writeInt64),(r=t.getFrozenList()).length>0&&e.writeRepeatedMessage(7,r,proto.protocol.Account.Frozen.serializeBinaryToWriter),0!==(r=t.getNetUsage())&&e.writeInt64(8,r),0!==(r=t.getAcquiredDelegatedFrozenBalanceForBandwidth())&&e.writeInt64(41,r),0!==(r=t.getDelegatedFrozenBalanceForBandwidth())&&e.writeInt64(42,r),0!==(r=t.getOldTronPower())&&e.writeInt64(46,r),null!=(r=t.getTronPower())&&e.writeMessage(47,r,proto.protocol.Account.Frozen.serializeBinaryToWriter),(r=t.getAssetOptimized())&&e.writeBool(60,r),0!==(r=t.getCreateTime())&&e.writeInt64(9,r),0!==(r=t.getLatestOprationTime())&&e.writeInt64(10,r),0!==(r=t.getAllowance())&&e.writeInt64(11,r),0!==(r=t.getLatestWithdrawTime())&&e.writeInt64(12,r),(r=t.getCode_asU8()).length>0&&e.writeBytes(13,r),(r=t.getIsWitness())&&e.writeBool(14,r),(r=t.getIsCommittee())&&e.writeBool(15,r),(r=t.getFrozenSupplyList()).length>0&&e.writeRepeatedMessage(16,r,proto.protocol.Account.Frozen.serializeBinaryToWriter),(r=t.getAssetIssuedName_asU8()).length>0&&e.writeBytes(17,r),(r=t.getAssetIssuedId_asU8()).length>0&&e.writeBytes(57,r),(r=t.getLatestAssetOperationTimeMap(!0))&&r.getLength()>0&&r.serializeBinary(18,e,o.BinaryWriter.prototype.writeString,o.BinaryWriter.prototype.writeInt64),(r=t.getLatestAssetOperationTimev2Map(!0))&&r.getLength()>0&&r.serializeBinary(58,e,o.BinaryWriter.prototype.writeString,o.BinaryWriter.prototype.writeInt64),0!==(r=t.getFreeNetUsage())&&e.writeInt64(19,r),(r=t.getFreeAssetNetUsageMap(!0))&&r.getLength()>0&&r.serializeBinary(20,e,o.BinaryWriter.prototype.writeString,o.BinaryWriter.prototype.writeInt64),(r=t.getFreeAssetNetUsagev2Map(!0))&&r.getLength()>0&&r.serializeBinary(59,e,o.BinaryWriter.prototype.writeString,o.BinaryWriter.prototype.writeInt64),0!==(r=t.getLatestConsumeTime())&&e.writeInt64(21,r),0!==(r=t.getLatestConsumeFreeTime())&&e.writeInt64(22,r),(r=t.getAccountId_asU8()).length>0&&e.writeBytes(23,r),null!=(r=t.getAccountResource())&&e.writeMessage(26,r,proto.protocol.Account.AccountResource.serializeBinaryToWriter),(r=t.getCodehash_asU8()).length>0&&e.writeBytes(30,r),null!=(r=t.getOwnerPermission())&&e.writeMessage(31,r,proto.protocol.Permission.serializeBinaryToWriter),null!=(r=t.getWitnessPermission())&&e.writeMessage(32,r,proto.protocol.Permission.serializeBinaryToWriter),(r=t.getActivePermissionList()).length>0&&e.writeRepeatedMessage(33,r,proto.protocol.Permission.serializeBinaryToWriter)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Account.Frozen.prototype.toObject=function(t){return proto.protocol.Account.Frozen.toObject(t,this)},proto.protocol.Account.Frozen.toObject=function(t,e){var r={frozenBalance:o.Message.getFieldWithDefault(e,1,0),expireTime:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Account.Frozen.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Account.Frozen;return proto.protocol.Account.Frozen.deserializeBinaryFromReader(r,e)},proto.protocol.Account.Frozen.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setFrozenBalance(r);break;case 2:r=e.readInt64();t.setExpireTime(r);break;default:e.skipField()}}return t},proto.protocol.Account.Frozen.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Account.Frozen.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Account.Frozen.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getFrozenBalance())&&e.writeInt64(1,r),0!==(r=t.getExpireTime())&&e.writeInt64(2,r)},proto.protocol.Account.Frozen.prototype.getFrozenBalance=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.Account.Frozen.prototype.setFrozenBalance=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.Account.Frozen.prototype.getExpireTime=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.Account.Frozen.prototype.setExpireTime=function(t){return o.Message.setProto3IntField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Account.AccountResource.prototype.toObject=function(t){return proto.protocol.Account.AccountResource.toObject(t,this)},proto.protocol.Account.AccountResource.toObject=function(t,e){var r,n={energyUsage:o.Message.getFieldWithDefault(e,1,0),frozenBalanceForEnergy:(r=e.getFrozenBalanceForEnergy())&&proto.protocol.Account.Frozen.toObject(t,r),latestConsumeTimeForEnergy:o.Message.getFieldWithDefault(e,3,0),acquiredDelegatedFrozenBalanceForEnergy:o.Message.getFieldWithDefault(e,4,0),delegatedFrozenBalanceForEnergy:o.Message.getFieldWithDefault(e,5,0),storageLimit:o.Message.getFieldWithDefault(e,6,0),storageUsage:o.Message.getFieldWithDefault(e,7,0),latestExchangeStorageTime:o.Message.getFieldWithDefault(e,8,0)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.Account.AccountResource.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Account.AccountResource;return proto.protocol.Account.AccountResource.deserializeBinaryFromReader(r,e)},proto.protocol.Account.AccountResource.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setEnergyUsage(r);break;case 2:r=new proto.protocol.Account.Frozen;e.readMessage(r,proto.protocol.Account.Frozen.deserializeBinaryFromReader),t.setFrozenBalanceForEnergy(r);break;case 3:r=e.readInt64();t.setLatestConsumeTimeForEnergy(r);break;case 4:r=e.readInt64();t.setAcquiredDelegatedFrozenBalanceForEnergy(r);break;case 5:r=e.readInt64();t.setDelegatedFrozenBalanceForEnergy(r);break;case 6:r=e.readInt64();t.setStorageLimit(r);break;case 7:r=e.readInt64();t.setStorageUsage(r);break;case 8:r=e.readInt64();t.setLatestExchangeStorageTime(r);break;default:e.skipField()}}return t},proto.protocol.Account.AccountResource.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Account.AccountResource.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Account.AccountResource.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getEnergyUsage())&&e.writeInt64(1,r),null!=(r=t.getFrozenBalanceForEnergy())&&e.writeMessage(2,r,proto.protocol.Account.Frozen.serializeBinaryToWriter),0!==(r=t.getLatestConsumeTimeForEnergy())&&e.writeInt64(3,r),0!==(r=t.getAcquiredDelegatedFrozenBalanceForEnergy())&&e.writeInt64(4,r),0!==(r=t.getDelegatedFrozenBalanceForEnergy())&&e.writeInt64(5,r),0!==(r=t.getStorageLimit())&&e.writeInt64(6,r),0!==(r=t.getStorageUsage())&&e.writeInt64(7,r),0!==(r=t.getLatestExchangeStorageTime())&&e.writeInt64(8,r)},proto.protocol.Account.AccountResource.prototype.getEnergyUsage=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.Account.AccountResource.prototype.setEnergyUsage=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.Account.AccountResource.prototype.getFrozenBalanceForEnergy=function(){return o.Message.getWrapperField(this,proto.protocol.Account.Frozen,2)},proto.protocol.Account.AccountResource.prototype.setFrozenBalanceForEnergy=function(t){return o.Message.setWrapperField(this,2,t)},proto.protocol.Account.AccountResource.prototype.clearFrozenBalanceForEnergy=function(){return this.setFrozenBalanceForEnergy(void 0)},proto.protocol.Account.AccountResource.prototype.hasFrozenBalanceForEnergy=function(){return null!=o.Message.getField(this,2)},proto.protocol.Account.AccountResource.prototype.getLatestConsumeTimeForEnergy=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.Account.AccountResource.prototype.setLatestConsumeTimeForEnergy=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.Account.AccountResource.prototype.getAcquiredDelegatedFrozenBalanceForEnergy=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.Account.AccountResource.prototype.setAcquiredDelegatedFrozenBalanceForEnergy=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.Account.AccountResource.prototype.getDelegatedFrozenBalanceForEnergy=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.Account.AccountResource.prototype.setDelegatedFrozenBalanceForEnergy=function(t){return o.Message.setProto3IntField(this,5,t)},proto.protocol.Account.AccountResource.prototype.getStorageLimit=function(){return o.Message.getFieldWithDefault(this,6,0)},proto.protocol.Account.AccountResource.prototype.setStorageLimit=function(t){return o.Message.setProto3IntField(this,6,t)},proto.protocol.Account.AccountResource.prototype.getStorageUsage=function(){return o.Message.getFieldWithDefault(this,7,0)},proto.protocol.Account.AccountResource.prototype.setStorageUsage=function(t){return o.Message.setProto3IntField(this,7,t)},proto.protocol.Account.AccountResource.prototype.getLatestExchangeStorageTime=function(){return o.Message.getFieldWithDefault(this,8,0)},proto.protocol.Account.AccountResource.prototype.setLatestExchangeStorageTime=function(t){return o.Message.setProto3IntField(this,8,t)},proto.protocol.Account.prototype.getAccountName=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.Account.prototype.getAccountName_asB64=function(){return o.Message.bytesAsB64(this.getAccountName())},proto.protocol.Account.prototype.getAccountName_asU8=function(){return o.Message.bytesAsU8(this.getAccountName())},proto.protocol.Account.prototype.setAccountName=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.Account.prototype.getType=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.Account.prototype.setType=function(t){return o.Message.setProto3EnumField(this,2,t)},proto.protocol.Account.prototype.getAddress=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.Account.prototype.getAddress_asB64=function(){return o.Message.bytesAsB64(this.getAddress())},proto.protocol.Account.prototype.getAddress_asU8=function(){return o.Message.bytesAsU8(this.getAddress())},proto.protocol.Account.prototype.setAddress=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.Account.prototype.getBalance=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.Account.prototype.setBalance=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.Account.prototype.getVotesList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Vote,5)},proto.protocol.Account.prototype.setVotesList=function(t){return o.Message.setRepeatedWrapperField(this,5,t)},proto.protocol.Account.prototype.addVotes=function(t,e){return o.Message.addToRepeatedWrapperField(this,5,t,proto.protocol.Vote,e)},proto.protocol.Account.prototype.clearVotesList=function(){return this.setVotesList([])},proto.protocol.Account.prototype.getAssetMap=function(t){return o.Message.getMapField(this,6,t,null)},proto.protocol.Account.prototype.clearAssetMap=function(){return this.getAssetMap().clear(),this},proto.protocol.Account.prototype.getAssetv2Map=function(t){return o.Message.getMapField(this,56,t,null)},proto.protocol.Account.prototype.clearAssetv2Map=function(){return this.getAssetv2Map().clear(),this},proto.protocol.Account.prototype.getFrozenList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Account.Frozen,7)},proto.protocol.Account.prototype.setFrozenList=function(t){return o.Message.setRepeatedWrapperField(this,7,t)},proto.protocol.Account.prototype.addFrozen=function(t,e){return o.Message.addToRepeatedWrapperField(this,7,t,proto.protocol.Account.Frozen,e)},proto.protocol.Account.prototype.clearFrozenList=function(){return this.setFrozenList([])},proto.protocol.Account.prototype.getNetUsage=function(){return o.Message.getFieldWithDefault(this,8,0)},proto.protocol.Account.prototype.setNetUsage=function(t){return o.Message.setProto3IntField(this,8,t)},proto.protocol.Account.prototype.getAcquiredDelegatedFrozenBalanceForBandwidth=function(){return o.Message.getFieldWithDefault(this,41,0)},proto.protocol.Account.prototype.setAcquiredDelegatedFrozenBalanceForBandwidth=function(t){return o.Message.setProto3IntField(this,41,t)},proto.protocol.Account.prototype.getDelegatedFrozenBalanceForBandwidth=function(){return o.Message.getFieldWithDefault(this,42,0)},proto.protocol.Account.prototype.setDelegatedFrozenBalanceForBandwidth=function(t){return o.Message.setProto3IntField(this,42,t)},proto.protocol.Account.prototype.getOldTronPower=function(){return o.Message.getFieldWithDefault(this,46,0)},proto.protocol.Account.prototype.setOldTronPower=function(t){return o.Message.setProto3IntField(this,46,t)},proto.protocol.Account.prototype.getTronPower=function(){return o.Message.getWrapperField(this,proto.protocol.Account.Frozen,47)},proto.protocol.Account.prototype.setTronPower=function(t){return o.Message.setWrapperField(this,47,t)},proto.protocol.Account.prototype.clearTronPower=function(){return this.setTronPower(void 0)},proto.protocol.Account.prototype.hasTronPower=function(){return null!=o.Message.getField(this,47)},proto.protocol.Account.prototype.getAssetOptimized=function(){return o.Message.getBooleanFieldWithDefault(this,60,!1)},proto.protocol.Account.prototype.setAssetOptimized=function(t){return o.Message.setProto3BooleanField(this,60,t)},proto.protocol.Account.prototype.getCreateTime=function(){return o.Message.getFieldWithDefault(this,9,0)},proto.protocol.Account.prototype.setCreateTime=function(t){return o.Message.setProto3IntField(this,9,t)},proto.protocol.Account.prototype.getLatestOprationTime=function(){return o.Message.getFieldWithDefault(this,10,0)},proto.protocol.Account.prototype.setLatestOprationTime=function(t){return o.Message.setProto3IntField(this,10,t)},proto.protocol.Account.prototype.getAllowance=function(){return o.Message.getFieldWithDefault(this,11,0)},proto.protocol.Account.prototype.setAllowance=function(t){return o.Message.setProto3IntField(this,11,t)},proto.protocol.Account.prototype.getLatestWithdrawTime=function(){return o.Message.getFieldWithDefault(this,12,0)},proto.protocol.Account.prototype.setLatestWithdrawTime=function(t){return o.Message.setProto3IntField(this,12,t)},proto.protocol.Account.prototype.getCode=function(){return o.Message.getFieldWithDefault(this,13,"")},proto.protocol.Account.prototype.getCode_asB64=function(){return o.Message.bytesAsB64(this.getCode())},proto.protocol.Account.prototype.getCode_asU8=function(){return o.Message.bytesAsU8(this.getCode())},proto.protocol.Account.prototype.setCode=function(t){return o.Message.setProto3BytesField(this,13,t)},proto.protocol.Account.prototype.getIsWitness=function(){return o.Message.getBooleanFieldWithDefault(this,14,!1)},proto.protocol.Account.prototype.setIsWitness=function(t){return o.Message.setProto3BooleanField(this,14,t)},proto.protocol.Account.prototype.getIsCommittee=function(){return o.Message.getBooleanFieldWithDefault(this,15,!1)},proto.protocol.Account.prototype.setIsCommittee=function(t){return o.Message.setProto3BooleanField(this,15,t)},proto.protocol.Account.prototype.getFrozenSupplyList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Account.Frozen,16)},proto.protocol.Account.prototype.setFrozenSupplyList=function(t){return o.Message.setRepeatedWrapperField(this,16,t)},proto.protocol.Account.prototype.addFrozenSupply=function(t,e){return o.Message.addToRepeatedWrapperField(this,16,t,proto.protocol.Account.Frozen,e)},proto.protocol.Account.prototype.clearFrozenSupplyList=function(){return this.setFrozenSupplyList([])},proto.protocol.Account.prototype.getAssetIssuedName=function(){return o.Message.getFieldWithDefault(this,17,"")},proto.protocol.Account.prototype.getAssetIssuedName_asB64=function(){return o.Message.bytesAsB64(this.getAssetIssuedName())},proto.protocol.Account.prototype.getAssetIssuedName_asU8=function(){return o.Message.bytesAsU8(this.getAssetIssuedName())},proto.protocol.Account.prototype.setAssetIssuedName=function(t){return o.Message.setProto3BytesField(this,17,t)},proto.protocol.Account.prototype.getAssetIssuedId=function(){return o.Message.getFieldWithDefault(this,57,"")},proto.protocol.Account.prototype.getAssetIssuedId_asB64=function(){return o.Message.bytesAsB64(this.getAssetIssuedId())},proto.protocol.Account.prototype.getAssetIssuedId_asU8=function(){return o.Message.bytesAsU8(this.getAssetIssuedId())},proto.protocol.Account.prototype.setAssetIssuedId=function(t){return o.Message.setProto3BytesField(this,57,t)},proto.protocol.Account.prototype.getLatestAssetOperationTimeMap=function(t){return o.Message.getMapField(this,18,t,null)},proto.protocol.Account.prototype.clearLatestAssetOperationTimeMap=function(){return this.getLatestAssetOperationTimeMap().clear(),this},proto.protocol.Account.prototype.getLatestAssetOperationTimev2Map=function(t){return o.Message.getMapField(this,58,t,null)},proto.protocol.Account.prototype.clearLatestAssetOperationTimev2Map=function(){return this.getLatestAssetOperationTimev2Map().clear(),this},proto.protocol.Account.prototype.getFreeNetUsage=function(){return o.Message.getFieldWithDefault(this,19,0)},proto.protocol.Account.prototype.setFreeNetUsage=function(t){return o.Message.setProto3IntField(this,19,t)},proto.protocol.Account.prototype.getFreeAssetNetUsageMap=function(t){return o.Message.getMapField(this,20,t,null)},proto.protocol.Account.prototype.clearFreeAssetNetUsageMap=function(){return this.getFreeAssetNetUsageMap().clear(),this},proto.protocol.Account.prototype.getFreeAssetNetUsagev2Map=function(t){return o.Message.getMapField(this,59,t,null)},proto.protocol.Account.prototype.clearFreeAssetNetUsagev2Map=function(){return this.getFreeAssetNetUsagev2Map().clear(),this},proto.protocol.Account.prototype.getLatestConsumeTime=function(){return o.Message.getFieldWithDefault(this,21,0)},proto.protocol.Account.prototype.setLatestConsumeTime=function(t){return o.Message.setProto3IntField(this,21,t)},proto.protocol.Account.prototype.getLatestConsumeFreeTime=function(){return o.Message.getFieldWithDefault(this,22,0)},proto.protocol.Account.prototype.setLatestConsumeFreeTime=function(t){return o.Message.setProto3IntField(this,22,t)},proto.protocol.Account.prototype.getAccountId=function(){return o.Message.getFieldWithDefault(this,23,"")},proto.protocol.Account.prototype.getAccountId_asB64=function(){return o.Message.bytesAsB64(this.getAccountId())},proto.protocol.Account.prototype.getAccountId_asU8=function(){return o.Message.bytesAsU8(this.getAccountId())},proto.protocol.Account.prototype.setAccountId=function(t){return o.Message.setProto3BytesField(this,23,t)},proto.protocol.Account.prototype.getAccountResource=function(){return o.Message.getWrapperField(this,proto.protocol.Account.AccountResource,26)},proto.protocol.Account.prototype.setAccountResource=function(t){return o.Message.setWrapperField(this,26,t)},proto.protocol.Account.prototype.clearAccountResource=function(){return this.setAccountResource(void 0)},proto.protocol.Account.prototype.hasAccountResource=function(){return null!=o.Message.getField(this,26)},proto.protocol.Account.prototype.getCodehash=function(){return o.Message.getFieldWithDefault(this,30,"")},proto.protocol.Account.prototype.getCodehash_asB64=function(){return o.Message.bytesAsB64(this.getCodehash())},proto.protocol.Account.prototype.getCodehash_asU8=function(){return o.Message.bytesAsU8(this.getCodehash())},proto.protocol.Account.prototype.setCodehash=function(t){return o.Message.setProto3BytesField(this,30,t)},proto.protocol.Account.prototype.getOwnerPermission=function(){return o.Message.getWrapperField(this,proto.protocol.Permission,31)},proto.protocol.Account.prototype.setOwnerPermission=function(t){return o.Message.setWrapperField(this,31,t)},proto.protocol.Account.prototype.clearOwnerPermission=function(){return this.setOwnerPermission(void 0)},proto.protocol.Account.prototype.hasOwnerPermission=function(){return null!=o.Message.getField(this,31)},proto.protocol.Account.prototype.getWitnessPermission=function(){return o.Message.getWrapperField(this,proto.protocol.Permission,32)},proto.protocol.Account.prototype.setWitnessPermission=function(t){return o.Message.setWrapperField(this,32,t)},proto.protocol.Account.prototype.clearWitnessPermission=function(){return this.setWitnessPermission(void 0)},proto.protocol.Account.prototype.hasWitnessPermission=function(){return null!=o.Message.getField(this,32)},proto.protocol.Account.prototype.getActivePermissionList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Permission,33)},proto.protocol.Account.prototype.setActivePermissionList=function(t){return o.Message.setRepeatedWrapperField(this,33,t)},proto.protocol.Account.prototype.addActivePermission=function(t,e){return o.Message.addToRepeatedWrapperField(this,33,t,proto.protocol.Permission,e)},proto.protocol.Account.prototype.clearActivePermissionList=function(){return this.setActivePermissionList([])},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Key.prototype.toObject=function(t){return proto.protocol.Key.toObject(t,this)},proto.protocol.Key.toObject=function(t,e){var r={address:e.getAddress_asB64(),weight:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Key.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Key;return proto.protocol.Key.deserializeBinaryFromReader(r,e)},proto.protocol.Key.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setAddress(r);break;case 2:r=e.readInt64();t.setWeight(r);break;default:e.skipField()}}return t},proto.protocol.Key.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Key.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Key.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getWeight())&&e.writeInt64(2,r)},proto.protocol.Key.prototype.getAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.Key.prototype.getAddress_asB64=function(){return o.Message.bytesAsB64(this.getAddress())},proto.protocol.Key.prototype.getAddress_asU8=function(){return o.Message.bytesAsU8(this.getAddress())},proto.protocol.Key.prototype.setAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.Key.prototype.getWeight=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.Key.prototype.setWeight=function(t){return o.Message.setProto3IntField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.DelegatedResource.prototype.toObject=function(t){return proto.protocol.DelegatedResource.toObject(t,this)},proto.protocol.DelegatedResource.toObject=function(t,e){var r={from:e.getFrom_asB64(),to:e.getTo_asB64(),frozenBalanceForBandwidth:o.Message.getFieldWithDefault(e,3,0),frozenBalanceForEnergy:o.Message.getFieldWithDefault(e,4,0),expireTimeForBandwidth:o.Message.getFieldWithDefault(e,5,0),expireTimeForEnergy:o.Message.getFieldWithDefault(e,6,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.DelegatedResource.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.DelegatedResource;return proto.protocol.DelegatedResource.deserializeBinaryFromReader(r,e)},proto.protocol.DelegatedResource.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setFrom(r);break;case 2:r=e.readBytes();t.setTo(r);break;case 3:r=e.readInt64();t.setFrozenBalanceForBandwidth(r);break;case 4:r=e.readInt64();t.setFrozenBalanceForEnergy(r);break;case 5:r=e.readInt64();t.setExpireTimeForBandwidth(r);break;case 6:r=e.readInt64();t.setExpireTimeForEnergy(r);break;default:e.skipField()}}return t},proto.protocol.DelegatedResource.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.DelegatedResource.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.DelegatedResource.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getFrom_asU8()).length>0&&e.writeBytes(1,r),(r=t.getTo_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getFrozenBalanceForBandwidth())&&e.writeInt64(3,r),0!==(r=t.getFrozenBalanceForEnergy())&&e.writeInt64(4,r),0!==(r=t.getExpireTimeForBandwidth())&&e.writeInt64(5,r),0!==(r=t.getExpireTimeForEnergy())&&e.writeInt64(6,r)},proto.protocol.DelegatedResource.prototype.getFrom=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.DelegatedResource.prototype.getFrom_asB64=function(){return o.Message.bytesAsB64(this.getFrom())},proto.protocol.DelegatedResource.prototype.getFrom_asU8=function(){return o.Message.bytesAsU8(this.getFrom())},proto.protocol.DelegatedResource.prototype.setFrom=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.DelegatedResource.prototype.getTo=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.DelegatedResource.prototype.getTo_asB64=function(){return o.Message.bytesAsB64(this.getTo())},proto.protocol.DelegatedResource.prototype.getTo_asU8=function(){return o.Message.bytesAsU8(this.getTo())},proto.protocol.DelegatedResource.prototype.setTo=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.DelegatedResource.prototype.getFrozenBalanceForBandwidth=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.DelegatedResource.prototype.setFrozenBalanceForBandwidth=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.DelegatedResource.prototype.getFrozenBalanceForEnergy=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.DelegatedResource.prototype.setFrozenBalanceForEnergy=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.DelegatedResource.prototype.getExpireTimeForBandwidth=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.DelegatedResource.prototype.setExpireTimeForBandwidth=function(t){return o.Message.setProto3IntField(this,5,t)},proto.protocol.DelegatedResource.prototype.getExpireTimeForEnergy=function(){return o.Message.getFieldWithDefault(this,6,0)},proto.protocol.DelegatedResource.prototype.setExpireTimeForEnergy=function(t){return o.Message.setProto3IntField(this,6,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.authority.prototype.toObject=function(t){return proto.protocol.authority.toObject(t,this)},proto.protocol.authority.toObject=function(t,e){var r,o={account:(r=e.getAccount())&&proto.protocol.AccountId.toObject(t,r),permissionName:e.getPermissionName_asB64()};return t&&(o.$jspbMessageInstance=e),o}),proto.protocol.authority.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.authority;return proto.protocol.authority.deserializeBinaryFromReader(r,e)},proto.protocol.authority.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=new proto.protocol.AccountId;e.readMessage(r,proto.protocol.AccountId.deserializeBinaryFromReader),t.setAccount(r);break;case 2:r=e.readBytes();t.setPermissionName(r);break;default:e.skipField()}}return t},proto.protocol.authority.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.authority.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.authority.serializeBinaryToWriter=function(t,e){var r=void 0;null!=(r=t.getAccount())&&e.writeMessage(1,r,proto.protocol.AccountId.serializeBinaryToWriter),(r=t.getPermissionName_asU8()).length>0&&e.writeBytes(2,r)},proto.protocol.authority.prototype.getAccount=function(){return o.Message.getWrapperField(this,proto.protocol.AccountId,1)},proto.protocol.authority.prototype.setAccount=function(t){return o.Message.setWrapperField(this,1,t)},proto.protocol.authority.prototype.clearAccount=function(){return this.setAccount(void 0)},proto.protocol.authority.prototype.hasAccount=function(){return null!=o.Message.getField(this,1)},proto.protocol.authority.prototype.getPermissionName=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.authority.prototype.getPermissionName_asB64=function(){return o.Message.bytesAsB64(this.getPermissionName())},proto.protocol.authority.prototype.getPermissionName_asU8=function(){return o.Message.bytesAsU8(this.getPermissionName())},proto.protocol.authority.prototype.setPermissionName=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.Permission.repeatedFields_=[7],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Permission.prototype.toObject=function(t){return proto.protocol.Permission.toObject(t,this)},proto.protocol.Permission.toObject=function(t,e){var r={type:o.Message.getFieldWithDefault(e,1,0),id:o.Message.getFieldWithDefault(e,2,0),permissionName:o.Message.getFieldWithDefault(e,3,""),threshold:o.Message.getFieldWithDefault(e,4,0),parentId:o.Message.getFieldWithDefault(e,5,0),operations:e.getOperations_asB64(),keysList:o.Message.toObjectList(e.getKeysList(),proto.protocol.Key.toObject,t)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Permission.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Permission;return proto.protocol.Permission.deserializeBinaryFromReader(r,e)},proto.protocol.Permission.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readEnum();t.setType(r);break;case 2:r=e.readInt32();t.setId(r);break;case 3:r=e.readString();t.setPermissionName(r);break;case 4:r=e.readInt64();t.setThreshold(r);break;case 5:r=e.readInt32();t.setParentId(r);break;case 6:r=e.readBytes();t.setOperations(r);break;case 7:r=new proto.protocol.Key;e.readMessage(r,proto.protocol.Key.deserializeBinaryFromReader),t.addKeys(r);break;default:e.skipField()}}return t},proto.protocol.Permission.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Permission.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Permission.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getType())&&e.writeEnum(1,r),0!==(r=t.getId())&&e.writeInt32(2,r),(r=t.getPermissionName()).length>0&&e.writeString(3,r),0!==(r=t.getThreshold())&&e.writeInt64(4,r),0!==(r=t.getParentId())&&e.writeInt32(5,r),(r=t.getOperations_asU8()).length>0&&e.writeBytes(6,r),(r=t.getKeysList()).length>0&&e.writeRepeatedMessage(7,r,proto.protocol.Key.serializeBinaryToWriter)},proto.protocol.Permission.PermissionType={OWNER:0,WITNESS:1,ACTIVE:2},proto.protocol.Permission.prototype.getType=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.Permission.prototype.setType=function(t){return o.Message.setProto3EnumField(this,1,t)},proto.protocol.Permission.prototype.getId=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.Permission.prototype.setId=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.Permission.prototype.getPermissionName=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.Permission.prototype.setPermissionName=function(t){return o.Message.setProto3StringField(this,3,t)},proto.protocol.Permission.prototype.getThreshold=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.Permission.prototype.setThreshold=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.Permission.prototype.getParentId=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.Permission.prototype.setParentId=function(t){return o.Message.setProto3IntField(this,5,t)},proto.protocol.Permission.prototype.getOperations=function(){return o.Message.getFieldWithDefault(this,6,"")},proto.protocol.Permission.prototype.getOperations_asB64=function(){return o.Message.bytesAsB64(this.getOperations())},proto.protocol.Permission.prototype.getOperations_asU8=function(){return o.Message.bytesAsU8(this.getOperations())},proto.protocol.Permission.prototype.setOperations=function(t){return o.Message.setProto3BytesField(this,6,t)},proto.protocol.Permission.prototype.getKeysList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Key,7)},proto.protocol.Permission.prototype.setKeysList=function(t){return o.Message.setRepeatedWrapperField(this,7,t)},proto.protocol.Permission.prototype.addKeys=function(t,e){return o.Message.addToRepeatedWrapperField(this,7,t,proto.protocol.Key,e)},proto.protocol.Permission.prototype.clearKeysList=function(){return this.setKeysList([])},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Witness.prototype.toObject=function(t){return proto.protocol.Witness.toObject(t,this)},proto.protocol.Witness.toObject=function(t,e){var r={address:e.getAddress_asB64(),votecount:o.Message.getFieldWithDefault(e,2,0),pubkey:e.getPubkey_asB64(),url:o.Message.getFieldWithDefault(e,4,""),totalproduced:o.Message.getFieldWithDefault(e,5,0),totalmissed:o.Message.getFieldWithDefault(e,6,0),latestblocknum:o.Message.getFieldWithDefault(e,7,0),latestslotnum:o.Message.getFieldWithDefault(e,8,0),isjobs:o.Message.getBooleanFieldWithDefault(e,9,!1)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Witness.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Witness;return proto.protocol.Witness.deserializeBinaryFromReader(r,e)},proto.protocol.Witness.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setAddress(r);break;case 2:r=e.readInt64();t.setVotecount(r);break;case 3:r=e.readBytes();t.setPubkey(r);break;case 4:r=e.readString();t.setUrl(r);break;case 5:r=e.readInt64();t.setTotalproduced(r);break;case 6:r=e.readInt64();t.setTotalmissed(r);break;case 7:r=e.readInt64();t.setLatestblocknum(r);break;case 8:r=e.readInt64();t.setLatestslotnum(r);break;case 9:r=e.readBool();t.setIsjobs(r);break;default:e.skipField()}}return t},proto.protocol.Witness.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Witness.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Witness.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getVotecount())&&e.writeInt64(2,r),(r=t.getPubkey_asU8()).length>0&&e.writeBytes(3,r),(r=t.getUrl()).length>0&&e.writeString(4,r),0!==(r=t.getTotalproduced())&&e.writeInt64(5,r),0!==(r=t.getTotalmissed())&&e.writeInt64(6,r),0!==(r=t.getLatestblocknum())&&e.writeInt64(7,r),0!==(r=t.getLatestslotnum())&&e.writeInt64(8,r),(r=t.getIsjobs())&&e.writeBool(9,r)},proto.protocol.Witness.prototype.getAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.Witness.prototype.getAddress_asB64=function(){return o.Message.bytesAsB64(this.getAddress())},proto.protocol.Witness.prototype.getAddress_asU8=function(){return o.Message.bytesAsU8(this.getAddress())},proto.protocol.Witness.prototype.setAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.Witness.prototype.getVotecount=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.Witness.prototype.setVotecount=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.Witness.prototype.getPubkey=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.Witness.prototype.getPubkey_asB64=function(){return o.Message.bytesAsB64(this.getPubkey())},proto.protocol.Witness.prototype.getPubkey_asU8=function(){return o.Message.bytesAsU8(this.getPubkey())},proto.protocol.Witness.prototype.setPubkey=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.Witness.prototype.getUrl=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.Witness.prototype.setUrl=function(t){return o.Message.setProto3StringField(this,4,t)},proto.protocol.Witness.prototype.getTotalproduced=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.Witness.prototype.setTotalproduced=function(t){return o.Message.setProto3IntField(this,5,t)},proto.protocol.Witness.prototype.getTotalmissed=function(){return o.Message.getFieldWithDefault(this,6,0)},proto.protocol.Witness.prototype.setTotalmissed=function(t){return o.Message.setProto3IntField(this,6,t)},proto.protocol.Witness.prototype.getLatestblocknum=function(){return o.Message.getFieldWithDefault(this,7,0)},proto.protocol.Witness.prototype.setLatestblocknum=function(t){return o.Message.setProto3IntField(this,7,t)},proto.protocol.Witness.prototype.getLatestslotnum=function(){return o.Message.getFieldWithDefault(this,8,0)},proto.protocol.Witness.prototype.setLatestslotnum=function(t){return o.Message.setProto3IntField(this,8,t)},proto.protocol.Witness.prototype.getIsjobs=function(){return o.Message.getBooleanFieldWithDefault(this,9,!1)},proto.protocol.Witness.prototype.setIsjobs=function(t){return o.Message.setProto3BooleanField(this,9,t)},proto.protocol.Votes.repeatedFields_=[2,3],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Votes.prototype.toObject=function(t){return proto.protocol.Votes.toObject(t,this)},proto.protocol.Votes.toObject=function(t,e){var r={address:e.getAddress_asB64(),oldVotesList:o.Message.toObjectList(e.getOldVotesList(),proto.protocol.Vote.toObject,t),newVotesList:o.Message.toObjectList(e.getNewVotesList(),proto.protocol.Vote.toObject,t)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Votes.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Votes;return proto.protocol.Votes.deserializeBinaryFromReader(r,e)},proto.protocol.Votes.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setAddress(r);break;case 2:r=new proto.protocol.Vote;e.readMessage(r,proto.protocol.Vote.deserializeBinaryFromReader),t.addOldVotes(r);break;case 3:r=new proto.protocol.Vote;e.readMessage(r,proto.protocol.Vote.deserializeBinaryFromReader),t.addNewVotes(r);break;default:e.skipField()}}return t},proto.protocol.Votes.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Votes.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Votes.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getOldVotesList()).length>0&&e.writeRepeatedMessage(2,r,proto.protocol.Vote.serializeBinaryToWriter),(r=t.getNewVotesList()).length>0&&e.writeRepeatedMessage(3,r,proto.protocol.Vote.serializeBinaryToWriter)},proto.protocol.Votes.prototype.getAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.Votes.prototype.getAddress_asB64=function(){return o.Message.bytesAsB64(this.getAddress())},proto.protocol.Votes.prototype.getAddress_asU8=function(){return o.Message.bytesAsU8(this.getAddress())},proto.protocol.Votes.prototype.setAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.Votes.prototype.getOldVotesList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Vote,2)},proto.protocol.Votes.prototype.setOldVotesList=function(t){return o.Message.setRepeatedWrapperField(this,2,t)},proto.protocol.Votes.prototype.addOldVotes=function(t,e){return o.Message.addToRepeatedWrapperField(this,2,t,proto.protocol.Vote,e)},proto.protocol.Votes.prototype.clearOldVotesList=function(){return this.setOldVotesList([])},proto.protocol.Votes.prototype.getNewVotesList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Vote,3)},proto.protocol.Votes.prototype.setNewVotesList=function(t){return o.Message.setRepeatedWrapperField(this,3,t)},proto.protocol.Votes.prototype.addNewVotes=function(t,e){return o.Message.addToRepeatedWrapperField(this,3,t,proto.protocol.Vote,e)},proto.protocol.Votes.prototype.clearNewVotesList=function(){return this.setNewVotesList([])},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.MarketOrderDetail.prototype.toObject=function(t){return proto.protocol.MarketOrderDetail.toObject(t,this)},proto.protocol.MarketOrderDetail.toObject=function(t,e){var r={makerorderid:e.getMakerorderid_asB64(),takerorderid:e.getTakerorderid_asB64(),fillsellquantity:o.Message.getFieldWithDefault(e,3,0),fillbuyquantity:o.Message.getFieldWithDefault(e,4,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.MarketOrderDetail.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.MarketOrderDetail;return proto.protocol.MarketOrderDetail.deserializeBinaryFromReader(r,e)},proto.protocol.MarketOrderDetail.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setMakerorderid(r);break;case 2:r=e.readBytes();t.setTakerorderid(r);break;case 3:r=e.readInt64();t.setFillsellquantity(r);break;case 4:r=e.readInt64();t.setFillbuyquantity(r);break;default:e.skipField()}}return t},proto.protocol.MarketOrderDetail.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.MarketOrderDetail.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.MarketOrderDetail.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getMakerorderid_asU8()).length>0&&e.writeBytes(1,r),(r=t.getTakerorderid_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getFillsellquantity())&&e.writeInt64(3,r),0!==(r=t.getFillbuyquantity())&&e.writeInt64(4,r)},proto.protocol.MarketOrderDetail.prototype.getMakerorderid=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.MarketOrderDetail.prototype.getMakerorderid_asB64=function(){return o.Message.bytesAsB64(this.getMakerorderid())},proto.protocol.MarketOrderDetail.prototype.getMakerorderid_asU8=function(){return o.Message.bytesAsU8(this.getMakerorderid())},proto.protocol.MarketOrderDetail.prototype.setMakerorderid=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.MarketOrderDetail.prototype.getTakerorderid=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.MarketOrderDetail.prototype.getTakerorderid_asB64=function(){return o.Message.bytesAsB64(this.getTakerorderid())},proto.protocol.MarketOrderDetail.prototype.getTakerorderid_asU8=function(){return o.Message.bytesAsU8(this.getTakerorderid())},proto.protocol.MarketOrderDetail.prototype.setTakerorderid=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.MarketOrderDetail.prototype.getFillsellquantity=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.MarketOrderDetail.prototype.setFillsellquantity=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.MarketOrderDetail.prototype.getFillbuyquantity=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.MarketOrderDetail.prototype.setFillbuyquantity=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.Transaction.repeatedFields_=[2,5],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Transaction.prototype.toObject=function(t){return proto.protocol.Transaction.toObject(t,this)},proto.protocol.Transaction.toObject=function(t,e){var r,n={rawData:(r=e.getRawData())&&proto.protocol.Transaction.raw.toObject(t,r),signatureList:e.getSignatureList_asB64(),retList:o.Message.toObjectList(e.getRetList(),proto.protocol.Transaction.Result.toObject,t)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.Transaction.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Transaction;return proto.protocol.Transaction.deserializeBinaryFromReader(r,e)},proto.protocol.Transaction.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=new proto.protocol.Transaction.raw;e.readMessage(r,proto.protocol.Transaction.raw.deserializeBinaryFromReader),t.setRawData(r);break;case 2:r=e.readBytes();t.addSignature(r);break;case 5:r=new proto.protocol.Transaction.Result;e.readMessage(r,proto.protocol.Transaction.Result.deserializeBinaryFromReader),t.addRet(r);break;default:e.skipField()}}return t},proto.protocol.Transaction.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Transaction.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Transaction.serializeBinaryToWriter=function(t,e){var r=void 0;null!=(r=t.getRawData())&&e.writeMessage(1,r,proto.protocol.Transaction.raw.serializeBinaryToWriter),(r=t.getSignatureList_asU8()).length>0&&e.writeRepeatedBytes(2,r),(r=t.getRetList()).length>0&&e.writeRepeatedMessage(5,r,proto.protocol.Transaction.Result.serializeBinaryToWriter)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Transaction.Contract.prototype.toObject=function(t){return proto.protocol.Transaction.Contract.toObject(t,this)},proto.protocol.Transaction.Contract.toObject=function(t,e){var r,n={type:o.Message.getFieldWithDefault(e,1,0),parameter:(r=e.getParameter())&&a.Any.toObject(t,r),provider:e.getProvider_asB64(),contractname:e.getContractname_asB64(),permissionId:o.Message.getFieldWithDefault(e,5,0)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.Transaction.Contract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Transaction.Contract;return proto.protocol.Transaction.Contract.deserializeBinaryFromReader(r,e)},proto.protocol.Transaction.Contract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readEnum();t.setType(r);break;case 2:r=new a.Any;e.readMessage(r,a.Any.deserializeBinaryFromReader),t.setParameter(r);break;case 3:r=e.readBytes();t.setProvider(r);break;case 4:r=e.readBytes();t.setContractname(r);break;case 5:r=e.readInt32();t.setPermissionId(r);break;default:e.skipField()}}return t},proto.protocol.Transaction.Contract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Transaction.Contract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Transaction.Contract.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getType())&&e.writeEnum(1,r),null!=(r=t.getParameter())&&e.writeMessage(2,r,a.Any.serializeBinaryToWriter),(r=t.getProvider_asU8()).length>0&&e.writeBytes(3,r),(r=t.getContractname_asU8()).length>0&&e.writeBytes(4,r),0!==(r=t.getPermissionId())&&e.writeInt32(5,r)},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,UPDATEENERGYLIMITCONTRACT:45,ACCOUNTPERMISSIONUPDATECONTRACT:46,CLEARABICONTRACT:48,UPDATEBROKERAGECONTRACT:49,SHIELDEDTRANSFERCONTRACT:51,MARKETSELLASSETCONTRACT:52,MARKETCANCELORDERCONTRACT:53,FREEZEBALANCEV2CONTRACT:54,UNFREEZEBALANCEV2CONTRACT:55,WITHDRAWEXPIREUNFREEZECONTRACT:56,DELEGATERESOURCECONTRACT:57,UNDELEGATERESOURCECONTRACT:58},proto.protocol.Transaction.Contract.prototype.getType=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.Transaction.Contract.prototype.setType=function(t){return o.Message.setProto3EnumField(this,1,t)},proto.protocol.Transaction.Contract.prototype.getParameter=function(){return o.Message.getWrapperField(this,a.Any,2)},proto.protocol.Transaction.Contract.prototype.setParameter=function(t){return o.Message.setWrapperField(this,2,t)},proto.protocol.Transaction.Contract.prototype.clearParameter=function(){return this.setParameter(void 0)},proto.protocol.Transaction.Contract.prototype.hasParameter=function(){return null!=o.Message.getField(this,2)},proto.protocol.Transaction.Contract.prototype.getProvider=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.Transaction.Contract.prototype.getProvider_asB64=function(){return o.Message.bytesAsB64(this.getProvider())},proto.protocol.Transaction.Contract.prototype.getProvider_asU8=function(){return o.Message.bytesAsU8(this.getProvider())},proto.protocol.Transaction.Contract.prototype.setProvider=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.Transaction.Contract.prototype.getContractname=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.Transaction.Contract.prototype.getContractname_asB64=function(){return o.Message.bytesAsB64(this.getContractname())},proto.protocol.Transaction.Contract.prototype.getContractname_asU8=function(){return o.Message.bytesAsU8(this.getContractname())},proto.protocol.Transaction.Contract.prototype.setContractname=function(t){return o.Message.setProto3BytesField(this,4,t)},proto.protocol.Transaction.Contract.prototype.getPermissionId=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.Transaction.Contract.prototype.setPermissionId=function(t){return o.Message.setProto3IntField(this,5,t)},proto.protocol.Transaction.Result.repeatedFields_=[26],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Transaction.Result.prototype.toObject=function(t){return proto.protocol.Transaction.Result.toObject(t,this)},proto.protocol.Transaction.Result.toObject=function(t,e){var r={fee:o.Message.getFieldWithDefault(e,1,0),ret:o.Message.getFieldWithDefault(e,2,0),contractret:o.Message.getFieldWithDefault(e,3,0),assetissueid:o.Message.getFieldWithDefault(e,14,""),withdrawAmount:o.Message.getFieldWithDefault(e,15,0),unfreezeAmount:o.Message.getFieldWithDefault(e,16,0),exchangeReceivedAmount:o.Message.getFieldWithDefault(e,18,0),exchangeInjectAnotherAmount:o.Message.getFieldWithDefault(e,19,0),exchangeWithdrawAnotherAmount:o.Message.getFieldWithDefault(e,20,0),exchangeId:o.Message.getFieldWithDefault(e,21,0),shieldedTransactionFee:o.Message.getFieldWithDefault(e,22,0),orderid:e.getOrderid_asB64(),orderdetailsList:o.Message.toObjectList(e.getOrderdetailsList(),proto.protocol.MarketOrderDetail.toObject,t)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Transaction.Result.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Transaction.Result;return proto.protocol.Transaction.Result.deserializeBinaryFromReader(r,e)},proto.protocol.Transaction.Result.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setFee(r);break;case 2:r=e.readEnum();t.setRet(r);break;case 3:r=e.readEnum();t.setContractret(r);break;case 14:r=e.readString();t.setAssetissueid(r);break;case 15:r=e.readInt64();t.setWithdrawAmount(r);break;case 16:r=e.readInt64();t.setUnfreezeAmount(r);break;case 18:r=e.readInt64();t.setExchangeReceivedAmount(r);break;case 19:r=e.readInt64();t.setExchangeInjectAnotherAmount(r);break;case 20:r=e.readInt64();t.setExchangeWithdrawAnotherAmount(r);break;case 21:r=e.readInt64();t.setExchangeId(r);break;case 22:r=e.readInt64();t.setShieldedTransactionFee(r);break;case 25:r=e.readBytes();t.setOrderid(r);break;case 26:r=new proto.protocol.MarketOrderDetail;e.readMessage(r,proto.protocol.MarketOrderDetail.deserializeBinaryFromReader),t.addOrderdetails(r);break;default:e.skipField()}}return t},proto.protocol.Transaction.Result.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Transaction.Result.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Transaction.Result.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getFee())&&e.writeInt64(1,r),0!==(r=t.getRet())&&e.writeEnum(2,r),0!==(r=t.getContractret())&&e.writeEnum(3,r),(r=t.getAssetissueid()).length>0&&e.writeString(14,r),0!==(r=t.getWithdrawAmount())&&e.writeInt64(15,r),0!==(r=t.getUnfreezeAmount())&&e.writeInt64(16,r),0!==(r=t.getExchangeReceivedAmount())&&e.writeInt64(18,r),0!==(r=t.getExchangeInjectAnotherAmount())&&e.writeInt64(19,r),0!==(r=t.getExchangeWithdrawAnotherAmount())&&e.writeInt64(20,r),0!==(r=t.getExchangeId())&&e.writeInt64(21,r),0!==(r=t.getShieldedTransactionFee())&&e.writeInt64(22,r),(r=t.getOrderid_asU8()).length>0&&e.writeBytes(25,r),(r=t.getOrderdetailsList()).length>0&&e.writeRepeatedMessage(26,r,proto.protocol.MarketOrderDetail.serializeBinaryToWriter)},proto.protocol.Transaction.Result.code={SUCESS:0,FAILED:1},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,TRANSFER_FAILED:14,INVALID_CODE:15},proto.protocol.Transaction.Result.prototype.getFee=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.Transaction.Result.prototype.setFee=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.Transaction.Result.prototype.getRet=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.Transaction.Result.prototype.setRet=function(t){return o.Message.setProto3EnumField(this,2,t)},proto.protocol.Transaction.Result.prototype.getContractret=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.Transaction.Result.prototype.setContractret=function(t){return o.Message.setProto3EnumField(this,3,t)},proto.protocol.Transaction.Result.prototype.getAssetissueid=function(){return o.Message.getFieldWithDefault(this,14,"")},proto.protocol.Transaction.Result.prototype.setAssetissueid=function(t){return o.Message.setProto3StringField(this,14,t)},proto.protocol.Transaction.Result.prototype.getWithdrawAmount=function(){return o.Message.getFieldWithDefault(this,15,0)},proto.protocol.Transaction.Result.prototype.setWithdrawAmount=function(t){return o.Message.setProto3IntField(this,15,t)},proto.protocol.Transaction.Result.prototype.getUnfreezeAmount=function(){return o.Message.getFieldWithDefault(this,16,0)},proto.protocol.Transaction.Result.prototype.setUnfreezeAmount=function(t){return o.Message.setProto3IntField(this,16,t)},proto.protocol.Transaction.Result.prototype.getExchangeReceivedAmount=function(){return o.Message.getFieldWithDefault(this,18,0)},proto.protocol.Transaction.Result.prototype.setExchangeReceivedAmount=function(t){return o.Message.setProto3IntField(this,18,t)},proto.protocol.Transaction.Result.prototype.getExchangeInjectAnotherAmount=function(){return o.Message.getFieldWithDefault(this,19,0)},proto.protocol.Transaction.Result.prototype.setExchangeInjectAnotherAmount=function(t){return o.Message.setProto3IntField(this,19,t)},proto.protocol.Transaction.Result.prototype.getExchangeWithdrawAnotherAmount=function(){return o.Message.getFieldWithDefault(this,20,0)},proto.protocol.Transaction.Result.prototype.setExchangeWithdrawAnotherAmount=function(t){return o.Message.setProto3IntField(this,20,t)},proto.protocol.Transaction.Result.prototype.getExchangeId=function(){return o.Message.getFieldWithDefault(this,21,0)},proto.protocol.Transaction.Result.prototype.setExchangeId=function(t){return o.Message.setProto3IntField(this,21,t)},proto.protocol.Transaction.Result.prototype.getShieldedTransactionFee=function(){return o.Message.getFieldWithDefault(this,22,0)},proto.protocol.Transaction.Result.prototype.setShieldedTransactionFee=function(t){return o.Message.setProto3IntField(this,22,t)},proto.protocol.Transaction.Result.prototype.getOrderid=function(){return o.Message.getFieldWithDefault(this,25,"")},proto.protocol.Transaction.Result.prototype.getOrderid_asB64=function(){return o.Message.bytesAsB64(this.getOrderid())},proto.protocol.Transaction.Result.prototype.getOrderid_asU8=function(){return o.Message.bytesAsU8(this.getOrderid())},proto.protocol.Transaction.Result.prototype.setOrderid=function(t){return o.Message.setProto3BytesField(this,25,t)},proto.protocol.Transaction.Result.prototype.getOrderdetailsList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.MarketOrderDetail,26)},proto.protocol.Transaction.Result.prototype.setOrderdetailsList=function(t){return o.Message.setRepeatedWrapperField(this,26,t)},proto.protocol.Transaction.Result.prototype.addOrderdetails=function(t,e){return o.Message.addToRepeatedWrapperField(this,26,t,proto.protocol.MarketOrderDetail,e)},proto.protocol.Transaction.Result.prototype.clearOrderdetailsList=function(){return this.setOrderdetailsList([])},proto.protocol.Transaction.raw.repeatedFields_=[9,11],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.Transaction.raw.prototype.toObject=function(t){return proto.protocol.Transaction.raw.toObject(t,this)},proto.protocol.Transaction.raw.toObject=function(t,e){var r={refBlockBytes:e.getRefBlockBytes_asB64(),refBlockNum:o.Message.getFieldWithDefault(e,3,0),refBlockHash:e.getRefBlockHash_asB64(),expiration:o.Message.getFieldWithDefault(e,8,0),authsList:o.Message.toObjectList(e.getAuthsList(),proto.protocol.authority.toObject,t),data:e.getData_asB64(),contractList:o.Message.toObjectList(e.getContractList(),proto.protocol.Transaction.Contract.toObject,t),scripts:e.getScripts_asB64(),timestamp:o.Message.getFieldWithDefault(e,14,0),feeLimit:o.Message.getFieldWithDefault(e,18,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.Transaction.raw.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.Transaction.raw;return proto.protocol.Transaction.raw.deserializeBinaryFromReader(r,e)},proto.protocol.Transaction.raw.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setRefBlockBytes(r);break;case 3:r=e.readInt64();t.setRefBlockNum(r);break;case 4:r=e.readBytes();t.setRefBlockHash(r);break;case 8:r=e.readInt64();t.setExpiration(r);break;case 9:r=new proto.protocol.authority;e.readMessage(r,proto.protocol.authority.deserializeBinaryFromReader),t.addAuths(r);break;case 10:r=e.readBytes();t.setData(r);break;case 11:r=new proto.protocol.Transaction.Contract;e.readMessage(r,proto.protocol.Transaction.Contract.deserializeBinaryFromReader),t.addContract(r);break;case 12:r=e.readBytes();t.setScripts(r);break;case 14:r=e.readInt64();t.setTimestamp(r);break;case 18:r=e.readInt64();t.setFeeLimit(r);break;default:e.skipField()}}return t},proto.protocol.Transaction.raw.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.Transaction.raw.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.Transaction.raw.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getRefBlockBytes_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getRefBlockNum())&&e.writeInt64(3,r),(r=t.getRefBlockHash_asU8()).length>0&&e.writeBytes(4,r),0!==(r=t.getExpiration())&&e.writeInt64(8,r),(r=t.getAuthsList()).length>0&&e.writeRepeatedMessage(9,r,proto.protocol.authority.serializeBinaryToWriter),(r=t.getData_asU8()).length>0&&e.writeBytes(10,r),(r=t.getContractList()).length>0&&e.writeRepeatedMessage(11,r,proto.protocol.Transaction.Contract.serializeBinaryToWriter),(r=t.getScripts_asU8()).length>0&&e.writeBytes(12,r),0!==(r=t.getTimestamp())&&e.writeInt64(14,r),0!==(r=t.getFeeLimit())&&e.writeInt64(18,r)},proto.protocol.Transaction.raw.prototype.getRefBlockBytes=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.Transaction.raw.prototype.getRefBlockBytes_asB64=function(){return o.Message.bytesAsB64(this.getRefBlockBytes())},proto.protocol.Transaction.raw.prototype.getRefBlockBytes_asU8=function(){return o.Message.bytesAsU8(this.getRefBlockBytes())},proto.protocol.Transaction.raw.prototype.setRefBlockBytes=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.Transaction.raw.prototype.getRefBlockNum=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.Transaction.raw.prototype.setRefBlockNum=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.Transaction.raw.prototype.getRefBlockHash=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.Transaction.raw.prototype.getRefBlockHash_asB64=function(){return o.Message.bytesAsB64(this.getRefBlockHash())},proto.protocol.Transaction.raw.prototype.getRefBlockHash_asU8=function(){return o.Message.bytesAsU8(this.getRefBlockHash())},proto.protocol.Transaction.raw.prototype.setRefBlockHash=function(t){return o.Message.setProto3BytesField(this,4,t)},proto.protocol.Transaction.raw.prototype.getExpiration=function(){return o.Message.getFieldWithDefault(this,8,0)},proto.protocol.Transaction.raw.prototype.setExpiration=function(t){return o.Message.setProto3IntField(this,8,t)},proto.protocol.Transaction.raw.prototype.getAuthsList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.authority,9)},proto.protocol.Transaction.raw.prototype.setAuthsList=function(t){return o.Message.setRepeatedWrapperField(this,9,t)},proto.protocol.Transaction.raw.prototype.addAuths=function(t,e){return o.Message.addToRepeatedWrapperField(this,9,t,proto.protocol.authority,e)},proto.protocol.Transaction.raw.prototype.clearAuthsList=function(){return this.setAuthsList([])},proto.protocol.Transaction.raw.prototype.getData=function(){return o.Message.getFieldWithDefault(this,10,"")},proto.protocol.Transaction.raw.prototype.getData_asB64=function(){return o.Message.bytesAsB64(this.getData())},proto.protocol.Transaction.raw.prototype.getData_asU8=function(){return o.Message.bytesAsU8(this.getData())},proto.protocol.Transaction.raw.prototype.setData=function(t){return o.Message.setProto3BytesField(this,10,t)},proto.protocol.Transaction.raw.prototype.getContractList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Transaction.Contract,11)},proto.protocol.Transaction.raw.prototype.setContractList=function(t){return o.Message.setRepeatedWrapperField(this,11,t)},proto.protocol.Transaction.raw.prototype.addContract=function(t,e){return o.Message.addToRepeatedWrapperField(this,11,t,proto.protocol.Transaction.Contract,e)},proto.protocol.Transaction.raw.prototype.clearContractList=function(){return this.setContractList([])},proto.protocol.Transaction.raw.prototype.getScripts=function(){return o.Message.getFieldWithDefault(this,12,"")},proto.protocol.Transaction.raw.prototype.getScripts_asB64=function(){return o.Message.bytesAsB64(this.getScripts())},proto.protocol.Transaction.raw.prototype.getScripts_asU8=function(){return o.Message.bytesAsU8(this.getScripts())},proto.protocol.Transaction.raw.prototype.setScripts=function(t){return o.Message.setProto3BytesField(this,12,t)},proto.protocol.Transaction.raw.prototype.getTimestamp=function(){return o.Message.getFieldWithDefault(this,14,0)},proto.protocol.Transaction.raw.prototype.setTimestamp=function(t){return o.Message.setProto3IntField(this,14,t)},proto.protocol.Transaction.raw.prototype.getFeeLimit=function(){return o.Message.getFieldWithDefault(this,18,0)},proto.protocol.Transaction.raw.prototype.setFeeLimit=function(t){return o.Message.setProto3IntField(this,18,t)},proto.protocol.Transaction.prototype.getRawData=function(){return o.Message.getWrapperField(this,proto.protocol.Transaction.raw,1)},proto.protocol.Transaction.prototype.setRawData=function(t){return o.Message.setWrapperField(this,1,t)},proto.protocol.Transaction.prototype.clearRawData=function(){return this.setRawData(void 0)},proto.protocol.Transaction.prototype.hasRawData=function(){return null!=o.Message.getField(this,1)},proto.protocol.Transaction.prototype.getSignatureList=function(){return o.Message.getRepeatedField(this,2)},proto.protocol.Transaction.prototype.getSignatureList_asB64=function(){return o.Message.bytesListAsB64(this.getSignatureList())},proto.protocol.Transaction.prototype.getSignatureList_asU8=function(){return o.Message.bytesListAsU8(this.getSignatureList())},proto.protocol.Transaction.prototype.setSignatureList=function(t){return o.Message.setField(this,2,t||[])},proto.protocol.Transaction.prototype.addSignature=function(t,e){return o.Message.addToRepeatedField(this,2,t,e)},proto.protocol.Transaction.prototype.clearSignatureList=function(){return this.setSignatureList([])},proto.protocol.Transaction.prototype.getRetList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.Transaction.Result,5)},proto.protocol.Transaction.prototype.setRetList=function(t){return o.Message.setRepeatedWrapperField(this,5,t)},proto.protocol.Transaction.prototype.addRet=function(t,e){return o.Message.addToRepeatedWrapperField(this,5,t,proto.protocol.Transaction.Result,e)},proto.protocol.Transaction.prototype.clearRetList=function(){return this.setRetList([])},proto.protocol.AccountType={NORMAL:0,ASSETISSUE:1,CONTRACT:2},n.object.extend(e,proto.protocol)},function(t,e,r){var o=r(8),n=function(){return this||window||n||self||Function("return this")()}.call(null);o.exportSymbol("proto.protocol.ResourceCode",null,n),proto.protocol.ResourceCode={BANDWIDTH:0,ENERGY:1,TRON_POWER:2},o.object.extend(e,proto.protocol)},function(t,e){t.exports=require("@babel/runtime/helpers/inherits")},function(t,e){t.exports=require("@babel/runtime/helpers/possibleConstructorReturn")},function(t,e){t.exports=require("axios")},function(t,e){t.exports=require("@ethersproject/strings")},function(t,e){t.exports=require("@ethersproject/logger")},function(t,e){t.exports=require("validator")},function(t,e){t.exports=require("eventemitter3")},function(t){t.exports=JSON.parse('{"a":"5.1.0"}')},function(t,e){t.exports=require("querystring")},function(t,e){t.exports=require("@tronweb3/google-protobuf/google/protobuf/any_pb")},function(t,e){t.exports=require("@tronweb3/google-protobuf/google/protobuf/any_pb.js")},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null),a=r(21);n.object.extend(proto,a),n.exportSymbol("proto.protocol.AccountBalanceRequest",null,s),n.exportSymbol("proto.protocol.AccountBalanceResponse",null,s),n.exportSymbol("proto.protocol.AccountIdentifier",null,s),n.exportSymbol("proto.protocol.AccountTrace",null,s),n.exportSymbol("proto.protocol.BlockBalanceTrace",null,s),n.exportSymbol("proto.protocol.BlockBalanceTrace.BlockIdentifier",null,s),n.exportSymbol("proto.protocol.DelegateResourceContract",null,s),n.exportSymbol("proto.protocol.FreezeBalanceContract",null,s),n.exportSymbol("proto.protocol.FreezeBalanceV2Contract",null,s),n.exportSymbol("proto.protocol.TransactionBalanceTrace",null,s),n.exportSymbol("proto.protocol.TransactionBalanceTrace.Operation",null,s),n.exportSymbol("proto.protocol.TransferContract",null,s),n.exportSymbol("proto.protocol.UnDelegateResourceContract",null,s),n.exportSymbol("proto.protocol.UnfreezeBalanceContract",null,s),n.exportSymbol("proto.protocol.UnfreezeBalanceV2Contract",null,s),n.exportSymbol("proto.protocol.WithdrawBalanceContract",null,s),n.exportSymbol("proto.protocol.WithdrawExpireUnfreezeContract",null,s),proto.protocol.FreezeBalanceContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.FreezeBalanceContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.FreezeBalanceContract.displayName="proto.protocol.FreezeBalanceContract"),proto.protocol.UnfreezeBalanceContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.UnfreezeBalanceContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.UnfreezeBalanceContract.displayName="proto.protocol.UnfreezeBalanceContract"),proto.protocol.WithdrawBalanceContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.WithdrawBalanceContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.WithdrawBalanceContract.displayName="proto.protocol.WithdrawBalanceContract"),proto.protocol.TransferContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.TransferContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.TransferContract.displayName="proto.protocol.TransferContract"),proto.protocol.TransactionBalanceTrace=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.TransactionBalanceTrace.repeatedFields_,null)},n.inherits(proto.protocol.TransactionBalanceTrace,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.TransactionBalanceTrace.displayName="proto.protocol.TransactionBalanceTrace"),proto.protocol.TransactionBalanceTrace.Operation=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.TransactionBalanceTrace.Operation,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.TransactionBalanceTrace.Operation.displayName="proto.protocol.TransactionBalanceTrace.Operation"),proto.protocol.BlockBalanceTrace=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.BlockBalanceTrace.repeatedFields_,null)},n.inherits(proto.protocol.BlockBalanceTrace,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.BlockBalanceTrace.displayName="proto.protocol.BlockBalanceTrace"),proto.protocol.BlockBalanceTrace.BlockIdentifier=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.BlockBalanceTrace.BlockIdentifier,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.BlockBalanceTrace.BlockIdentifier.displayName="proto.protocol.BlockBalanceTrace.BlockIdentifier"),proto.protocol.AccountTrace=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.AccountTrace,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AccountTrace.displayName="proto.protocol.AccountTrace"),proto.protocol.AccountIdentifier=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.AccountIdentifier,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AccountIdentifier.displayName="proto.protocol.AccountIdentifier"),proto.protocol.AccountBalanceRequest=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.AccountBalanceRequest,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AccountBalanceRequest.displayName="proto.protocol.AccountBalanceRequest"),proto.protocol.AccountBalanceResponse=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.AccountBalanceResponse,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AccountBalanceResponse.displayName="proto.protocol.AccountBalanceResponse"),proto.protocol.FreezeBalanceV2Contract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.FreezeBalanceV2Contract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.FreezeBalanceV2Contract.displayName="proto.protocol.FreezeBalanceV2Contract"),proto.protocol.UnfreezeBalanceV2Contract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.UnfreezeBalanceV2Contract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.UnfreezeBalanceV2Contract.displayName="proto.protocol.UnfreezeBalanceV2Contract"),proto.protocol.WithdrawExpireUnfreezeContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.WithdrawExpireUnfreezeContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.WithdrawExpireUnfreezeContract.displayName="proto.protocol.WithdrawExpireUnfreezeContract"),proto.protocol.DelegateResourceContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.DelegateResourceContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.DelegateResourceContract.displayName="proto.protocol.DelegateResourceContract"),proto.protocol.UnDelegateResourceContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.UnDelegateResourceContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.UnDelegateResourceContract.displayName="proto.protocol.UnDelegateResourceContract"),o.Message.GENERATE_TO_OBJECT&&(proto.protocol.FreezeBalanceContract.prototype.toObject=function(t){return proto.protocol.FreezeBalanceContract.toObject(t,this)},proto.protocol.FreezeBalanceContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),frozenBalance:o.Message.getFieldWithDefault(e,2,0),frozenDuration:o.Message.getFieldWithDefault(e,3,0),resource:o.Message.getFieldWithDefault(e,10,0),receiverAddress:e.getReceiverAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.FreezeBalanceContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.FreezeBalanceContract;return proto.protocol.FreezeBalanceContract.deserializeBinaryFromReader(r,e)},proto.protocol.FreezeBalanceContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setFrozenBalance(r);break;case 3:r=e.readInt64();t.setFrozenDuration(r);break;case 10:r=e.readEnum();t.setResource(r);break;case 15:r=e.readBytes();t.setReceiverAddress(r);break;default:e.skipField()}}return t},proto.protocol.FreezeBalanceContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.FreezeBalanceContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.FreezeBalanceContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getFrozenBalance())&&e.writeInt64(2,r),0!==(r=t.getFrozenDuration())&&e.writeInt64(3,r),0!==(r=t.getResource())&&e.writeEnum(10,r),(r=t.getReceiverAddress_asU8()).length>0&&e.writeBytes(15,r)},proto.protocol.FreezeBalanceContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.FreezeBalanceContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.FreezeBalanceContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.FreezeBalanceContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.FreezeBalanceContract.prototype.getFrozenBalance=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.FreezeBalanceContract.prototype.setFrozenBalance=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.FreezeBalanceContract.prototype.getFrozenDuration=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.FreezeBalanceContract.prototype.setFrozenDuration=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.FreezeBalanceContract.prototype.getResource=function(){return o.Message.getFieldWithDefault(this,10,0)},proto.protocol.FreezeBalanceContract.prototype.setResource=function(t){return o.Message.setProto3EnumField(this,10,t)},proto.protocol.FreezeBalanceContract.prototype.getReceiverAddress=function(){return o.Message.getFieldWithDefault(this,15,"")},proto.protocol.FreezeBalanceContract.prototype.getReceiverAddress_asB64=function(){return o.Message.bytesAsB64(this.getReceiverAddress())},proto.protocol.FreezeBalanceContract.prototype.getReceiverAddress_asU8=function(){return o.Message.bytesAsU8(this.getReceiverAddress())},proto.protocol.FreezeBalanceContract.prototype.setReceiverAddress=function(t){return o.Message.setProto3BytesField(this,15,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.UnfreezeBalanceContract.prototype.toObject=function(t){return proto.protocol.UnfreezeBalanceContract.toObject(t,this)},proto.protocol.UnfreezeBalanceContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),resource:o.Message.getFieldWithDefault(e,10,0),receiverAddress:e.getReceiverAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.UnfreezeBalanceContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.UnfreezeBalanceContract;return proto.protocol.UnfreezeBalanceContract.deserializeBinaryFromReader(r,e)},proto.protocol.UnfreezeBalanceContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 10:r=e.readEnum();t.setResource(r);break;case 15:r=e.readBytes();t.setReceiverAddress(r);break;default:e.skipField()}}return t},proto.protocol.UnfreezeBalanceContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.UnfreezeBalanceContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.UnfreezeBalanceContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getResource())&&e.writeEnum(10,r),(r=t.getReceiverAddress_asU8()).length>0&&e.writeBytes(15,r)},proto.protocol.UnfreezeBalanceContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.UnfreezeBalanceContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.UnfreezeBalanceContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.UnfreezeBalanceContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.UnfreezeBalanceContract.prototype.getResource=function(){return o.Message.getFieldWithDefault(this,10,0)},proto.protocol.UnfreezeBalanceContract.prototype.setResource=function(t){return o.Message.setProto3EnumField(this,10,t)},proto.protocol.UnfreezeBalanceContract.prototype.getReceiverAddress=function(){return o.Message.getFieldWithDefault(this,15,"")},proto.protocol.UnfreezeBalanceContract.prototype.getReceiverAddress_asB64=function(){return o.Message.bytesAsB64(this.getReceiverAddress())},proto.protocol.UnfreezeBalanceContract.prototype.getReceiverAddress_asU8=function(){return o.Message.bytesAsU8(this.getReceiverAddress())},proto.protocol.UnfreezeBalanceContract.prototype.setReceiverAddress=function(t){return o.Message.setProto3BytesField(this,15,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.WithdrawBalanceContract.prototype.toObject=function(t){return proto.protocol.WithdrawBalanceContract.toObject(t,this)},proto.protocol.WithdrawBalanceContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.WithdrawBalanceContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.WithdrawBalanceContract;return proto.protocol.WithdrawBalanceContract.deserializeBinaryFromReader(r,e)},proto.protocol.WithdrawBalanceContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;default:e.skipField()}}return t},proto.protocol.WithdrawBalanceContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.WithdrawBalanceContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.WithdrawBalanceContract.serializeBinaryToWriter=function(t,e){var r;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r)},proto.protocol.WithdrawBalanceContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.WithdrawBalanceContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.WithdrawBalanceContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.WithdrawBalanceContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.TransferContract.prototype.toObject=function(t){return proto.protocol.TransferContract.toObject(t,this)},proto.protocol.TransferContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),toAddress:e.getToAddress_asB64(),amount:o.Message.getFieldWithDefault(e,3,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.TransferContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.TransferContract;return proto.protocol.TransferContract.deserializeBinaryFromReader(r,e)},proto.protocol.TransferContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setToAddress(r);break;case 3:r=e.readInt64();t.setAmount(r);break;default:e.skipField()}}return t},proto.protocol.TransferContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.TransferContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.TransferContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getToAddress_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getAmount())&&e.writeInt64(3,r)},proto.protocol.TransferContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.TransferContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.TransferContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.TransferContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.TransferContract.prototype.getToAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.TransferContract.prototype.getToAddress_asB64=function(){return o.Message.bytesAsB64(this.getToAddress())},proto.protocol.TransferContract.prototype.getToAddress_asU8=function(){return o.Message.bytesAsU8(this.getToAddress())},proto.protocol.TransferContract.prototype.setToAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.TransferContract.prototype.getAmount=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.TransferContract.prototype.setAmount=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.TransactionBalanceTrace.repeatedFields_=[2],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.TransactionBalanceTrace.prototype.toObject=function(t){return proto.protocol.TransactionBalanceTrace.toObject(t,this)},proto.protocol.TransactionBalanceTrace.toObject=function(t,e){var r={transactionIdentifier:e.getTransactionIdentifier_asB64(),operationList:o.Message.toObjectList(e.getOperationList(),proto.protocol.TransactionBalanceTrace.Operation.toObject,t),type:o.Message.getFieldWithDefault(e,3,""),status:o.Message.getFieldWithDefault(e,4,"")};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.TransactionBalanceTrace.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.TransactionBalanceTrace;return proto.protocol.TransactionBalanceTrace.deserializeBinaryFromReader(r,e)},proto.protocol.TransactionBalanceTrace.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setTransactionIdentifier(r);break;case 2:r=new proto.protocol.TransactionBalanceTrace.Operation;e.readMessage(r,proto.protocol.TransactionBalanceTrace.Operation.deserializeBinaryFromReader),t.addOperation(r);break;case 3:r=e.readString();t.setType(r);break;case 4:r=e.readString();t.setStatus(r);break;default:e.skipField()}}return t},proto.protocol.TransactionBalanceTrace.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.TransactionBalanceTrace.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.TransactionBalanceTrace.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getTransactionIdentifier_asU8()).length>0&&e.writeBytes(1,r),(r=t.getOperationList()).length>0&&e.writeRepeatedMessage(2,r,proto.protocol.TransactionBalanceTrace.Operation.serializeBinaryToWriter),(r=t.getType()).length>0&&e.writeString(3,r),(r=t.getStatus()).length>0&&e.writeString(4,r)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.TransactionBalanceTrace.Operation.prototype.toObject=function(t){return proto.protocol.TransactionBalanceTrace.Operation.toObject(t,this)},proto.protocol.TransactionBalanceTrace.Operation.toObject=function(t,e){var r={operationIdentifier:o.Message.getFieldWithDefault(e,1,0),address:e.getAddress_asB64(),amount:o.Message.getFieldWithDefault(e,3,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.TransactionBalanceTrace.Operation.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.TransactionBalanceTrace.Operation;return proto.protocol.TransactionBalanceTrace.Operation.deserializeBinaryFromReader(r,e)},proto.protocol.TransactionBalanceTrace.Operation.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setOperationIdentifier(r);break;case 2:r=e.readBytes();t.setAddress(r);break;case 3:r=e.readInt64();t.setAmount(r);break;default:e.skipField()}}return t},proto.protocol.TransactionBalanceTrace.Operation.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.TransactionBalanceTrace.Operation.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.TransactionBalanceTrace.Operation.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getOperationIdentifier())&&e.writeInt64(1,r),(r=t.getAddress_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getAmount())&&e.writeInt64(3,r)},proto.protocol.TransactionBalanceTrace.Operation.prototype.getOperationIdentifier=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.TransactionBalanceTrace.Operation.prototype.setOperationIdentifier=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.TransactionBalanceTrace.Operation.prototype.getAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.TransactionBalanceTrace.Operation.prototype.getAddress_asB64=function(){return o.Message.bytesAsB64(this.getAddress())},proto.protocol.TransactionBalanceTrace.Operation.prototype.getAddress_asU8=function(){return o.Message.bytesAsU8(this.getAddress())},proto.protocol.TransactionBalanceTrace.Operation.prototype.setAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.TransactionBalanceTrace.Operation.prototype.getAmount=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.TransactionBalanceTrace.Operation.prototype.setAmount=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.TransactionBalanceTrace.prototype.getTransactionIdentifier=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.TransactionBalanceTrace.prototype.getTransactionIdentifier_asB64=function(){return o.Message.bytesAsB64(this.getTransactionIdentifier())},proto.protocol.TransactionBalanceTrace.prototype.getTransactionIdentifier_asU8=function(){return o.Message.bytesAsU8(this.getTransactionIdentifier())},proto.protocol.TransactionBalanceTrace.prototype.setTransactionIdentifier=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.TransactionBalanceTrace.prototype.getOperationList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.TransactionBalanceTrace.Operation,2)},proto.protocol.TransactionBalanceTrace.prototype.setOperationList=function(t){return o.Message.setRepeatedWrapperField(this,2,t)},proto.protocol.TransactionBalanceTrace.prototype.addOperation=function(t,e){return o.Message.addToRepeatedWrapperField(this,2,t,proto.protocol.TransactionBalanceTrace.Operation,e)},proto.protocol.TransactionBalanceTrace.prototype.clearOperationList=function(){return this.setOperationList([])},proto.protocol.TransactionBalanceTrace.prototype.getType=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.TransactionBalanceTrace.prototype.setType=function(t){return o.Message.setProto3StringField(this,3,t)},proto.protocol.TransactionBalanceTrace.prototype.getStatus=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.TransactionBalanceTrace.prototype.setStatus=function(t){return o.Message.setProto3StringField(this,4,t)},proto.protocol.BlockBalanceTrace.repeatedFields_=[3],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.BlockBalanceTrace.prototype.toObject=function(t){return proto.protocol.BlockBalanceTrace.toObject(t,this)},proto.protocol.BlockBalanceTrace.toObject=function(t,e){var r,n={blockIdentifier:(r=e.getBlockIdentifier())&&proto.protocol.BlockBalanceTrace.BlockIdentifier.toObject(t,r),timestamp:o.Message.getFieldWithDefault(e,2,0),transactionBalanceTraceList:o.Message.toObjectList(e.getTransactionBalanceTraceList(),proto.protocol.TransactionBalanceTrace.toObject,t)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.BlockBalanceTrace.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.BlockBalanceTrace;return proto.protocol.BlockBalanceTrace.deserializeBinaryFromReader(r,e)},proto.protocol.BlockBalanceTrace.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=new proto.protocol.BlockBalanceTrace.BlockIdentifier;e.readMessage(r,proto.protocol.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),t.setBlockIdentifier(r);break;case 2:r=e.readInt64();t.setTimestamp(r);break;case 3:r=new proto.protocol.TransactionBalanceTrace;e.readMessage(r,proto.protocol.TransactionBalanceTrace.deserializeBinaryFromReader),t.addTransactionBalanceTrace(r);break;default:e.skipField()}}return t},proto.protocol.BlockBalanceTrace.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.BlockBalanceTrace.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.BlockBalanceTrace.serializeBinaryToWriter=function(t,e){var r=void 0;null!=(r=t.getBlockIdentifier())&&e.writeMessage(1,r,proto.protocol.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter),0!==(r=t.getTimestamp())&&e.writeInt64(2,r),(r=t.getTransactionBalanceTraceList()).length>0&&e.writeRepeatedMessage(3,r,proto.protocol.TransactionBalanceTrace.serializeBinaryToWriter)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.BlockBalanceTrace.BlockIdentifier.prototype.toObject=function(t){return proto.protocol.BlockBalanceTrace.BlockIdentifier.toObject(t,this)},proto.protocol.BlockBalanceTrace.BlockIdentifier.toObject=function(t,e){var r={hash:e.getHash_asB64(),number:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.BlockBalanceTrace.BlockIdentifier.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.BlockBalanceTrace.BlockIdentifier;return proto.protocol.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader(r,e)},proto.protocol.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setHash(r);break;case 2:r=e.readInt64();t.setNumber(r);break;default:e.skipField()}}return t},proto.protocol.BlockBalanceTrace.BlockIdentifier.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getHash_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getNumber())&&e.writeInt64(2,r)},proto.protocol.BlockBalanceTrace.BlockIdentifier.prototype.getHash=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asB64=function(){return o.Message.bytesAsB64(this.getHash())},proto.protocol.BlockBalanceTrace.BlockIdentifier.prototype.getHash_asU8=function(){return o.Message.bytesAsU8(this.getHash())},proto.protocol.BlockBalanceTrace.BlockIdentifier.prototype.setHash=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.BlockBalanceTrace.BlockIdentifier.prototype.getNumber=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.BlockBalanceTrace.BlockIdentifier.prototype.setNumber=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.BlockBalanceTrace.prototype.getBlockIdentifier=function(){return o.Message.getWrapperField(this,proto.protocol.BlockBalanceTrace.BlockIdentifier,1)},proto.protocol.BlockBalanceTrace.prototype.setBlockIdentifier=function(t){return o.Message.setWrapperField(this,1,t)},proto.protocol.BlockBalanceTrace.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},proto.protocol.BlockBalanceTrace.prototype.hasBlockIdentifier=function(){return null!=o.Message.getField(this,1)},proto.protocol.BlockBalanceTrace.prototype.getTimestamp=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.BlockBalanceTrace.prototype.setTimestamp=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.BlockBalanceTrace.prototype.getTransactionBalanceTraceList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.TransactionBalanceTrace,3)},proto.protocol.BlockBalanceTrace.prototype.setTransactionBalanceTraceList=function(t){return o.Message.setRepeatedWrapperField(this,3,t)},proto.protocol.BlockBalanceTrace.prototype.addTransactionBalanceTrace=function(t,e){return o.Message.addToRepeatedWrapperField(this,3,t,proto.protocol.TransactionBalanceTrace,e)},proto.protocol.BlockBalanceTrace.prototype.clearTransactionBalanceTraceList=function(){return this.setTransactionBalanceTraceList([])},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AccountTrace.prototype.toObject=function(t){return proto.protocol.AccountTrace.toObject(t,this)},proto.protocol.AccountTrace.toObject=function(t,e){var r={balance:o.Message.getFieldWithDefault(e,1,0),placeholder:o.Message.getFieldWithDefault(e,99,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.AccountTrace.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AccountTrace;return proto.protocol.AccountTrace.deserializeBinaryFromReader(r,e)},proto.protocol.AccountTrace.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setBalance(r);break;case 99:r=e.readInt64();t.setPlaceholder(r);break;default:e.skipField()}}return t},proto.protocol.AccountTrace.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AccountTrace.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AccountTrace.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getBalance())&&e.writeInt64(1,r),0!==(r=t.getPlaceholder())&&e.writeInt64(99,r)},proto.protocol.AccountTrace.prototype.getBalance=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.AccountTrace.prototype.setBalance=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.AccountTrace.prototype.getPlaceholder=function(){return o.Message.getFieldWithDefault(this,99,0)},proto.protocol.AccountTrace.prototype.setPlaceholder=function(t){return o.Message.setProto3IntField(this,99,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AccountIdentifier.prototype.toObject=function(t){return proto.protocol.AccountIdentifier.toObject(t,this)},proto.protocol.AccountIdentifier.toObject=function(t,e){var r={address:e.getAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.AccountIdentifier.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AccountIdentifier;return proto.protocol.AccountIdentifier.deserializeBinaryFromReader(r,e)},proto.protocol.AccountIdentifier.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setAddress(r);break;default:e.skipField()}}return t},proto.protocol.AccountIdentifier.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AccountIdentifier.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AccountIdentifier.serializeBinaryToWriter=function(t,e){var r;(r=t.getAddress_asU8()).length>0&&e.writeBytes(1,r)},proto.protocol.AccountIdentifier.prototype.getAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.AccountIdentifier.prototype.getAddress_asB64=function(){return o.Message.bytesAsB64(this.getAddress())},proto.protocol.AccountIdentifier.prototype.getAddress_asU8=function(){return o.Message.bytesAsU8(this.getAddress())},proto.protocol.AccountIdentifier.prototype.setAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AccountBalanceRequest.prototype.toObject=function(t){return proto.protocol.AccountBalanceRequest.toObject(t,this)},proto.protocol.AccountBalanceRequest.toObject=function(t,e){var r,o={accountIdentifier:(r=e.getAccountIdentifier())&&proto.protocol.AccountIdentifier.toObject(t,r),blockIdentifier:(r=e.getBlockIdentifier())&&proto.protocol.BlockBalanceTrace.BlockIdentifier.toObject(t,r)};return t&&(o.$jspbMessageInstance=e),o}),proto.protocol.AccountBalanceRequest.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AccountBalanceRequest;return proto.protocol.AccountBalanceRequest.deserializeBinaryFromReader(r,e)},proto.protocol.AccountBalanceRequest.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=new proto.protocol.AccountIdentifier;e.readMessage(r,proto.protocol.AccountIdentifier.deserializeBinaryFromReader),t.setAccountIdentifier(r);break;case 2:r=new proto.protocol.BlockBalanceTrace.BlockIdentifier;e.readMessage(r,proto.protocol.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),t.setBlockIdentifier(r);break;default:e.skipField()}}return t},proto.protocol.AccountBalanceRequest.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AccountBalanceRequest.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AccountBalanceRequest.serializeBinaryToWriter=function(t,e){var r=void 0;null!=(r=t.getAccountIdentifier())&&e.writeMessage(1,r,proto.protocol.AccountIdentifier.serializeBinaryToWriter),null!=(r=t.getBlockIdentifier())&&e.writeMessage(2,r,proto.protocol.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter)},proto.protocol.AccountBalanceRequest.prototype.getAccountIdentifier=function(){return o.Message.getWrapperField(this,proto.protocol.AccountIdentifier,1)},proto.protocol.AccountBalanceRequest.prototype.setAccountIdentifier=function(t){return o.Message.setWrapperField(this,1,t)},proto.protocol.AccountBalanceRequest.prototype.clearAccountIdentifier=function(){return this.setAccountIdentifier(void 0)},proto.protocol.AccountBalanceRequest.prototype.hasAccountIdentifier=function(){return null!=o.Message.getField(this,1)},proto.protocol.AccountBalanceRequest.prototype.getBlockIdentifier=function(){return o.Message.getWrapperField(this,proto.protocol.BlockBalanceTrace.BlockIdentifier,2)},proto.protocol.AccountBalanceRequest.prototype.setBlockIdentifier=function(t){return o.Message.setWrapperField(this,2,t)},proto.protocol.AccountBalanceRequest.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},proto.protocol.AccountBalanceRequest.prototype.hasBlockIdentifier=function(){return null!=o.Message.getField(this,2)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AccountBalanceResponse.prototype.toObject=function(t){return proto.protocol.AccountBalanceResponse.toObject(t,this)},proto.protocol.AccountBalanceResponse.toObject=function(t,e){var r,n={balance:o.Message.getFieldWithDefault(e,1,0),blockIdentifier:(r=e.getBlockIdentifier())&&proto.protocol.BlockBalanceTrace.BlockIdentifier.toObject(t,r)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.AccountBalanceResponse.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AccountBalanceResponse;return proto.protocol.AccountBalanceResponse.deserializeBinaryFromReader(r,e)},proto.protocol.AccountBalanceResponse.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setBalance(r);break;case 2:r=new proto.protocol.BlockBalanceTrace.BlockIdentifier;e.readMessage(r,proto.protocol.BlockBalanceTrace.BlockIdentifier.deserializeBinaryFromReader),t.setBlockIdentifier(r);break;default:e.skipField()}}return t},proto.protocol.AccountBalanceResponse.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AccountBalanceResponse.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AccountBalanceResponse.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getBalance())&&e.writeInt64(1,r),null!=(r=t.getBlockIdentifier())&&e.writeMessage(2,r,proto.protocol.BlockBalanceTrace.BlockIdentifier.serializeBinaryToWriter)},proto.protocol.AccountBalanceResponse.prototype.getBalance=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.AccountBalanceResponse.prototype.setBalance=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.AccountBalanceResponse.prototype.getBlockIdentifier=function(){return o.Message.getWrapperField(this,proto.protocol.BlockBalanceTrace.BlockIdentifier,2)},proto.protocol.AccountBalanceResponse.prototype.setBlockIdentifier=function(t){return o.Message.setWrapperField(this,2,t)},proto.protocol.AccountBalanceResponse.prototype.clearBlockIdentifier=function(){return this.setBlockIdentifier(void 0)},proto.protocol.AccountBalanceResponse.prototype.hasBlockIdentifier=function(){return null!=o.Message.getField(this,2)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.FreezeBalanceV2Contract.prototype.toObject=function(t){return proto.protocol.FreezeBalanceV2Contract.toObject(t,this)},proto.protocol.FreezeBalanceV2Contract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),frozenBalance:o.Message.getFieldWithDefault(e,2,0),resource:o.Message.getFieldWithDefault(e,3,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.FreezeBalanceV2Contract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.FreezeBalanceV2Contract;return proto.protocol.FreezeBalanceV2Contract.deserializeBinaryFromReader(r,e)},proto.protocol.FreezeBalanceV2Contract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setFrozenBalance(r);break;case 3:r=e.readEnum();t.setResource(r);break;default:e.skipField()}}return t},proto.protocol.FreezeBalanceV2Contract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.FreezeBalanceV2Contract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.FreezeBalanceV2Contract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getFrozenBalance())&&e.writeInt64(2,r),0!==(r=t.getResource())&&e.writeEnum(3,r)},proto.protocol.FreezeBalanceV2Contract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.FreezeBalanceV2Contract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.FreezeBalanceV2Contract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.FreezeBalanceV2Contract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.FreezeBalanceV2Contract.prototype.getFrozenBalance=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.FreezeBalanceV2Contract.prototype.setFrozenBalance=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.FreezeBalanceV2Contract.prototype.getResource=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.FreezeBalanceV2Contract.prototype.setResource=function(t){return o.Message.setProto3EnumField(this,3,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.UnfreezeBalanceV2Contract.prototype.toObject=function(t){return proto.protocol.UnfreezeBalanceV2Contract.toObject(t,this)},proto.protocol.UnfreezeBalanceV2Contract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),unfreezeBalance:o.Message.getFieldWithDefault(e,2,0),resource:o.Message.getFieldWithDefault(e,3,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.UnfreezeBalanceV2Contract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.UnfreezeBalanceV2Contract;return proto.protocol.UnfreezeBalanceV2Contract.deserializeBinaryFromReader(r,e)},proto.protocol.UnfreezeBalanceV2Contract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setUnfreezeBalance(r);break;case 3:r=e.readEnum();t.setResource(r);break;default:e.skipField()}}return t},proto.protocol.UnfreezeBalanceV2Contract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.UnfreezeBalanceV2Contract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.UnfreezeBalanceV2Contract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getUnfreezeBalance())&&e.writeInt64(2,r),0!==(r=t.getResource())&&e.writeEnum(3,r)},proto.protocol.UnfreezeBalanceV2Contract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.UnfreezeBalanceV2Contract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.UnfreezeBalanceV2Contract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.UnfreezeBalanceV2Contract.prototype.getUnfreezeBalance=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.UnfreezeBalanceV2Contract.prototype.setUnfreezeBalance=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.UnfreezeBalanceV2Contract.prototype.getResource=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.UnfreezeBalanceV2Contract.prototype.setResource=function(t){return o.Message.setProto3EnumField(this,3,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.WithdrawExpireUnfreezeContract.prototype.toObject=function(t){return proto.protocol.WithdrawExpireUnfreezeContract.toObject(t,this)},proto.protocol.WithdrawExpireUnfreezeContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.WithdrawExpireUnfreezeContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.WithdrawExpireUnfreezeContract;return proto.protocol.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader(r,e)},proto.protocol.WithdrawExpireUnfreezeContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;default:e.skipField()}}return t},proto.protocol.WithdrawExpireUnfreezeContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.WithdrawExpireUnfreezeContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.WithdrawExpireUnfreezeContract.serializeBinaryToWriter=function(t,e){var r;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r)},proto.protocol.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.WithdrawExpireUnfreezeContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.WithdrawExpireUnfreezeContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.DelegateResourceContract.prototype.toObject=function(t){return proto.protocol.DelegateResourceContract.toObject(t,this)},proto.protocol.DelegateResourceContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),resource:o.Message.getFieldWithDefault(e,2,0),balance:o.Message.getFieldWithDefault(e,3,0),receiverAddress:e.getReceiverAddress_asB64(),lock:o.Message.getBooleanFieldWithDefault(e,5,!1)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.DelegateResourceContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.DelegateResourceContract;return proto.protocol.DelegateResourceContract.deserializeBinaryFromReader(r,e)},proto.protocol.DelegateResourceContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readEnum();t.setResource(r);break;case 3:r=e.readInt64();t.setBalance(r);break;case 4:r=e.readBytes();t.setReceiverAddress(r);break;case 5:r=e.readBool();t.setLock(r);break;default:e.skipField()}}return t},proto.protocol.DelegateResourceContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.DelegateResourceContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.DelegateResourceContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getResource())&&e.writeEnum(2,r),0!==(r=t.getBalance())&&e.writeInt64(3,r),(r=t.getReceiverAddress_asU8()).length>0&&e.writeBytes(4,r),(r=t.getLock())&&e.writeBool(5,r)},proto.protocol.DelegateResourceContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.DelegateResourceContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.DelegateResourceContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.DelegateResourceContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.DelegateResourceContract.prototype.getResource=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.DelegateResourceContract.prototype.setResource=function(t){return o.Message.setProto3EnumField(this,2,t)},proto.protocol.DelegateResourceContract.prototype.getBalance=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.DelegateResourceContract.prototype.setBalance=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.DelegateResourceContract.prototype.getReceiverAddress=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.DelegateResourceContract.prototype.getReceiverAddress_asB64=function(){return o.Message.bytesAsB64(this.getReceiverAddress())},proto.protocol.DelegateResourceContract.prototype.getReceiverAddress_asU8=function(){return o.Message.bytesAsU8(this.getReceiverAddress())},proto.protocol.DelegateResourceContract.prototype.setReceiverAddress=function(t){return o.Message.setProto3BytesField(this,4,t)},proto.protocol.DelegateResourceContract.prototype.getLock=function(){return o.Message.getBooleanFieldWithDefault(this,5,!1)},proto.protocol.DelegateResourceContract.prototype.setLock=function(t){return o.Message.setProto3BooleanField(this,5,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.UnDelegateResourceContract.prototype.toObject=function(t){return proto.protocol.UnDelegateResourceContract.toObject(t,this)},proto.protocol.UnDelegateResourceContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),resource:o.Message.getFieldWithDefault(e,2,0),balance:o.Message.getFieldWithDefault(e,3,0),receiverAddress:e.getReceiverAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.UnDelegateResourceContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.UnDelegateResourceContract;return proto.protocol.UnDelegateResourceContract.deserializeBinaryFromReader(r,e)},proto.protocol.UnDelegateResourceContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readEnum();t.setResource(r);break;case 3:r=e.readInt64();t.setBalance(r);break;case 4:r=e.readBytes();t.setReceiverAddress(r);break;default:e.skipField()}}return t},proto.protocol.UnDelegateResourceContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.UnDelegateResourceContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.UnDelegateResourceContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getResource())&&e.writeEnum(2,r),0!==(r=t.getBalance())&&e.writeInt64(3,r),(r=t.getReceiverAddress_asU8()).length>0&&e.writeBytes(4,r)},proto.protocol.UnDelegateResourceContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.UnDelegateResourceContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.UnDelegateResourceContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.UnDelegateResourceContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.UnDelegateResourceContract.prototype.getResource=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.UnDelegateResourceContract.prototype.setResource=function(t){return o.Message.setProto3EnumField(this,2,t)},proto.protocol.UnDelegateResourceContract.prototype.getBalance=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.UnDelegateResourceContract.prototype.setBalance=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.UnDelegateResourceContract.prototype.getReceiverAddress=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.UnDelegateResourceContract.prototype.getReceiverAddress_asB64=function(){return o.Message.bytesAsB64(this.getReceiverAddress())},proto.protocol.UnDelegateResourceContract.prototype.getReceiverAddress_asU8=function(){return o.Message.bytesAsU8(this.getReceiverAddress())},proto.protocol.UnDelegateResourceContract.prototype.setReceiverAddress=function(t){return o.Message.setProto3BytesField(this,4,t)},n.object.extend(e,proto.protocol)},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null);n.exportSymbol("proto.protocol.AssetIssueContract",null,s),n.exportSymbol("proto.protocol.AssetIssueContract.FrozenSupply",null,s),n.exportSymbol("proto.protocol.ParticipateAssetIssueContract",null,s),n.exportSymbol("proto.protocol.TransferAssetContract",null,s),n.exportSymbol("proto.protocol.UnfreezeAssetContract",null,s),n.exportSymbol("proto.protocol.UpdateAssetContract",null,s),proto.protocol.AssetIssueContract=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.AssetIssueContract.repeatedFields_,null)},n.inherits(proto.protocol.AssetIssueContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AssetIssueContract.displayName="proto.protocol.AssetIssueContract"),proto.protocol.AssetIssueContract.FrozenSupply=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.AssetIssueContract.FrozenSupply,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AssetIssueContract.FrozenSupply.displayName="proto.protocol.AssetIssueContract.FrozenSupply"),proto.protocol.TransferAssetContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.TransferAssetContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.TransferAssetContract.displayName="proto.protocol.TransferAssetContract"),proto.protocol.UnfreezeAssetContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.UnfreezeAssetContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.UnfreezeAssetContract.displayName="proto.protocol.UnfreezeAssetContract"),proto.protocol.UpdateAssetContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.UpdateAssetContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.UpdateAssetContract.displayName="proto.protocol.UpdateAssetContract"),proto.protocol.ParticipateAssetIssueContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ParticipateAssetIssueContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ParticipateAssetIssueContract.displayName="proto.protocol.ParticipateAssetIssueContract"),proto.protocol.AssetIssueContract.repeatedFields_=[5],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AssetIssueContract.prototype.toObject=function(t){return proto.protocol.AssetIssueContract.toObject(t,this)},proto.protocol.AssetIssueContract.toObject=function(t,e){var r={id:o.Message.getFieldWithDefault(e,41,""),ownerAddress:e.getOwnerAddress_asB64(),name:e.getName_asB64(),abbr:e.getAbbr_asB64(),totalSupply:o.Message.getFieldWithDefault(e,4,0),frozenSupplyList:o.Message.toObjectList(e.getFrozenSupplyList(),proto.protocol.AssetIssueContract.FrozenSupply.toObject,t),trxNum:o.Message.getFieldWithDefault(e,6,0),precision:o.Message.getFieldWithDefault(e,7,0),num:o.Message.getFieldWithDefault(e,8,0),startTime:o.Message.getFieldWithDefault(e,9,0),endTime:o.Message.getFieldWithDefault(e,10,0),order:o.Message.getFieldWithDefault(e,11,0),voteScore:o.Message.getFieldWithDefault(e,16,0),description:e.getDescription_asB64(),url:e.getUrl_asB64(),freeAssetNetLimit:o.Message.getFieldWithDefault(e,22,0),publicFreeAssetNetLimit:o.Message.getFieldWithDefault(e,23,0),publicFreeAssetNetUsage:o.Message.getFieldWithDefault(e,24,0),publicLatestFreeNetTime:o.Message.getFieldWithDefault(e,25,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.AssetIssueContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AssetIssueContract;return proto.protocol.AssetIssueContract.deserializeBinaryFromReader(r,e)},proto.protocol.AssetIssueContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 41:var r=e.readString();t.setId(r);break;case 1:r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setName(r);break;case 3:r=e.readBytes();t.setAbbr(r);break;case 4:r=e.readInt64();t.setTotalSupply(r);break;case 5:r=new proto.protocol.AssetIssueContract.FrozenSupply;e.readMessage(r,proto.protocol.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader),t.addFrozenSupply(r);break;case 6:r=e.readInt32();t.setTrxNum(r);break;case 7:r=e.readInt32();t.setPrecision(r);break;case 8:r=e.readInt32();t.setNum(r);break;case 9:r=e.readInt64();t.setStartTime(r);break;case 10:r=e.readInt64();t.setEndTime(r);break;case 11:r=e.readInt64();t.setOrder(r);break;case 16:r=e.readInt32();t.setVoteScore(r);break;case 20:r=e.readBytes();t.setDescription(r);break;case 21:r=e.readBytes();t.setUrl(r);break;case 22:r=e.readInt64();t.setFreeAssetNetLimit(r);break;case 23:r=e.readInt64();t.setPublicFreeAssetNetLimit(r);break;case 24:r=e.readInt64();t.setPublicFreeAssetNetUsage(r);break;case 25:r=e.readInt64();t.setPublicLatestFreeNetTime(r);break;default:e.skipField()}}return t},proto.protocol.AssetIssueContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AssetIssueContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AssetIssueContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getId()).length>0&&e.writeString(41,r),(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getName_asU8()).length>0&&e.writeBytes(2,r),(r=t.getAbbr_asU8()).length>0&&e.writeBytes(3,r),0!==(r=t.getTotalSupply())&&e.writeInt64(4,r),(r=t.getFrozenSupplyList()).length>0&&e.writeRepeatedMessage(5,r,proto.protocol.AssetIssueContract.FrozenSupply.serializeBinaryToWriter),0!==(r=t.getTrxNum())&&e.writeInt32(6,r),0!==(r=t.getPrecision())&&e.writeInt32(7,r),0!==(r=t.getNum())&&e.writeInt32(8,r),0!==(r=t.getStartTime())&&e.writeInt64(9,r),0!==(r=t.getEndTime())&&e.writeInt64(10,r),0!==(r=t.getOrder())&&e.writeInt64(11,r),0!==(r=t.getVoteScore())&&e.writeInt32(16,r),(r=t.getDescription_asU8()).length>0&&e.writeBytes(20,r),(r=t.getUrl_asU8()).length>0&&e.writeBytes(21,r),0!==(r=t.getFreeAssetNetLimit())&&e.writeInt64(22,r),0!==(r=t.getPublicFreeAssetNetLimit())&&e.writeInt64(23,r),0!==(r=t.getPublicFreeAssetNetUsage())&&e.writeInt64(24,r),0!==(r=t.getPublicLatestFreeNetTime())&&e.writeInt64(25,r)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AssetIssueContract.FrozenSupply.prototype.toObject=function(t){return proto.protocol.AssetIssueContract.FrozenSupply.toObject(t,this)},proto.protocol.AssetIssueContract.FrozenSupply.toObject=function(t,e){var r={frozenAmount:o.Message.getFieldWithDefault(e,1,0),frozenDays:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.AssetIssueContract.FrozenSupply.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AssetIssueContract.FrozenSupply;return proto.protocol.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader(r,e)},proto.protocol.AssetIssueContract.FrozenSupply.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readInt64();t.setFrozenAmount(r);break;case 2:r=e.readInt64();t.setFrozenDays(r);break;default:e.skipField()}}return t},proto.protocol.AssetIssueContract.FrozenSupply.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AssetIssueContract.FrozenSupply.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AssetIssueContract.FrozenSupply.serializeBinaryToWriter=function(t,e){var r=void 0;0!==(r=t.getFrozenAmount())&&e.writeInt64(1,r),0!==(r=t.getFrozenDays())&&e.writeInt64(2,r)},proto.protocol.AssetIssueContract.FrozenSupply.prototype.getFrozenAmount=function(){return o.Message.getFieldWithDefault(this,1,0)},proto.protocol.AssetIssueContract.FrozenSupply.prototype.setFrozenAmount=function(t){return o.Message.setProto3IntField(this,1,t)},proto.protocol.AssetIssueContract.FrozenSupply.prototype.getFrozenDays=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.AssetIssueContract.FrozenSupply.prototype.setFrozenDays=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.AssetIssueContract.prototype.getId=function(){return o.Message.getFieldWithDefault(this,41,"")},proto.protocol.AssetIssueContract.prototype.setId=function(t){return o.Message.setProto3StringField(this,41,t)},proto.protocol.AssetIssueContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.AssetIssueContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.AssetIssueContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.AssetIssueContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.AssetIssueContract.prototype.getName=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.AssetIssueContract.prototype.getName_asB64=function(){return o.Message.bytesAsB64(this.getName())},proto.protocol.AssetIssueContract.prototype.getName_asU8=function(){return o.Message.bytesAsU8(this.getName())},proto.protocol.AssetIssueContract.prototype.setName=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.AssetIssueContract.prototype.getAbbr=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.AssetIssueContract.prototype.getAbbr_asB64=function(){return o.Message.bytesAsB64(this.getAbbr())},proto.protocol.AssetIssueContract.prototype.getAbbr_asU8=function(){return o.Message.bytesAsU8(this.getAbbr())},proto.protocol.AssetIssueContract.prototype.setAbbr=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.AssetIssueContract.prototype.getTotalSupply=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.AssetIssueContract.prototype.setTotalSupply=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.AssetIssueContract.prototype.getFrozenSupplyList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.AssetIssueContract.FrozenSupply,5)},proto.protocol.AssetIssueContract.prototype.setFrozenSupplyList=function(t){return o.Message.setRepeatedWrapperField(this,5,t)},proto.protocol.AssetIssueContract.prototype.addFrozenSupply=function(t,e){return o.Message.addToRepeatedWrapperField(this,5,t,proto.protocol.AssetIssueContract.FrozenSupply,e)},proto.protocol.AssetIssueContract.prototype.clearFrozenSupplyList=function(){return this.setFrozenSupplyList([])},proto.protocol.AssetIssueContract.prototype.getTrxNum=function(){return o.Message.getFieldWithDefault(this,6,0)},proto.protocol.AssetIssueContract.prototype.setTrxNum=function(t){return o.Message.setProto3IntField(this,6,t)},proto.protocol.AssetIssueContract.prototype.getPrecision=function(){return o.Message.getFieldWithDefault(this,7,0)},proto.protocol.AssetIssueContract.prototype.setPrecision=function(t){return o.Message.setProto3IntField(this,7,t)},proto.protocol.AssetIssueContract.prototype.getNum=function(){return o.Message.getFieldWithDefault(this,8,0)},proto.protocol.AssetIssueContract.prototype.setNum=function(t){return o.Message.setProto3IntField(this,8,t)},proto.protocol.AssetIssueContract.prototype.getStartTime=function(){return o.Message.getFieldWithDefault(this,9,0)},proto.protocol.AssetIssueContract.prototype.setStartTime=function(t){return o.Message.setProto3IntField(this,9,t)},proto.protocol.AssetIssueContract.prototype.getEndTime=function(){return o.Message.getFieldWithDefault(this,10,0)},proto.protocol.AssetIssueContract.prototype.setEndTime=function(t){return o.Message.setProto3IntField(this,10,t)},proto.protocol.AssetIssueContract.prototype.getOrder=function(){return o.Message.getFieldWithDefault(this,11,0)},proto.protocol.AssetIssueContract.prototype.setOrder=function(t){return o.Message.setProto3IntField(this,11,t)},proto.protocol.AssetIssueContract.prototype.getVoteScore=function(){return o.Message.getFieldWithDefault(this,16,0)},proto.protocol.AssetIssueContract.prototype.setVoteScore=function(t){return o.Message.setProto3IntField(this,16,t)},proto.protocol.AssetIssueContract.prototype.getDescription=function(){return o.Message.getFieldWithDefault(this,20,"")},proto.protocol.AssetIssueContract.prototype.getDescription_asB64=function(){return o.Message.bytesAsB64(this.getDescription())},proto.protocol.AssetIssueContract.prototype.getDescription_asU8=function(){return o.Message.bytesAsU8(this.getDescription())},proto.protocol.AssetIssueContract.prototype.setDescription=function(t){return o.Message.setProto3BytesField(this,20,t)},proto.protocol.AssetIssueContract.prototype.getUrl=function(){return o.Message.getFieldWithDefault(this,21,"")},proto.protocol.AssetIssueContract.prototype.getUrl_asB64=function(){return o.Message.bytesAsB64(this.getUrl())},proto.protocol.AssetIssueContract.prototype.getUrl_asU8=function(){return o.Message.bytesAsU8(this.getUrl())},proto.protocol.AssetIssueContract.prototype.setUrl=function(t){return o.Message.setProto3BytesField(this,21,t)},proto.protocol.AssetIssueContract.prototype.getFreeAssetNetLimit=function(){return o.Message.getFieldWithDefault(this,22,0)},proto.protocol.AssetIssueContract.prototype.setFreeAssetNetLimit=function(t){return o.Message.setProto3IntField(this,22,t)},proto.protocol.AssetIssueContract.prototype.getPublicFreeAssetNetLimit=function(){return o.Message.getFieldWithDefault(this,23,0)},proto.protocol.AssetIssueContract.prototype.setPublicFreeAssetNetLimit=function(t){return o.Message.setProto3IntField(this,23,t)},proto.protocol.AssetIssueContract.prototype.getPublicFreeAssetNetUsage=function(){return o.Message.getFieldWithDefault(this,24,0)},proto.protocol.AssetIssueContract.prototype.setPublicFreeAssetNetUsage=function(t){return o.Message.setProto3IntField(this,24,t)},proto.protocol.AssetIssueContract.prototype.getPublicLatestFreeNetTime=function(){return o.Message.getFieldWithDefault(this,25,0)},proto.protocol.AssetIssueContract.prototype.setPublicLatestFreeNetTime=function(t){return o.Message.setProto3IntField(this,25,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.TransferAssetContract.prototype.toObject=function(t){return proto.protocol.TransferAssetContract.toObject(t,this)},proto.protocol.TransferAssetContract.toObject=function(t,e){var r={assetName:e.getAssetName_asB64(),ownerAddress:e.getOwnerAddress_asB64(),toAddress:e.getToAddress_asB64(),amount:o.Message.getFieldWithDefault(e,4,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.TransferAssetContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.TransferAssetContract;return proto.protocol.TransferAssetContract.deserializeBinaryFromReader(r,e)},proto.protocol.TransferAssetContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setAssetName(r);break;case 2:r=e.readBytes();t.setOwnerAddress(r);break;case 3:r=e.readBytes();t.setToAddress(r);break;case 4:r=e.readInt64();t.setAmount(r);break;default:e.skipField()}}return t},proto.protocol.TransferAssetContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.TransferAssetContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.TransferAssetContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getAssetName_asU8()).length>0&&e.writeBytes(1,r),(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(2,r),(r=t.getToAddress_asU8()).length>0&&e.writeBytes(3,r),0!==(r=t.getAmount())&&e.writeInt64(4,r)},proto.protocol.TransferAssetContract.prototype.getAssetName=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.TransferAssetContract.prototype.getAssetName_asB64=function(){return o.Message.bytesAsB64(this.getAssetName())},proto.protocol.TransferAssetContract.prototype.getAssetName_asU8=function(){return o.Message.bytesAsU8(this.getAssetName())},proto.protocol.TransferAssetContract.prototype.setAssetName=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.TransferAssetContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.TransferAssetContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.TransferAssetContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.TransferAssetContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.TransferAssetContract.prototype.getToAddress=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.TransferAssetContract.prototype.getToAddress_asB64=function(){return o.Message.bytesAsB64(this.getToAddress())},proto.protocol.TransferAssetContract.prototype.getToAddress_asU8=function(){return o.Message.bytesAsU8(this.getToAddress())},proto.protocol.TransferAssetContract.prototype.setToAddress=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.TransferAssetContract.prototype.getAmount=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.TransferAssetContract.prototype.setAmount=function(t){return o.Message.setProto3IntField(this,4,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.UnfreezeAssetContract.prototype.toObject=function(t){return proto.protocol.UnfreezeAssetContract.toObject(t,this)},proto.protocol.UnfreezeAssetContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.UnfreezeAssetContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.UnfreezeAssetContract;return proto.protocol.UnfreezeAssetContract.deserializeBinaryFromReader(r,e)},proto.protocol.UnfreezeAssetContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;default:e.skipField()}}return t},proto.protocol.UnfreezeAssetContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.UnfreezeAssetContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.UnfreezeAssetContract.serializeBinaryToWriter=function(t,e){var r;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r)},proto.protocol.UnfreezeAssetContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.UnfreezeAssetContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.UnfreezeAssetContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.UnfreezeAssetContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.UpdateAssetContract.prototype.toObject=function(t){return proto.protocol.UpdateAssetContract.toObject(t,this)},proto.protocol.UpdateAssetContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),description:e.getDescription_asB64(),url:e.getUrl_asB64(),newLimit:o.Message.getFieldWithDefault(e,4,0),newPublicLimit:o.Message.getFieldWithDefault(e,5,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.UpdateAssetContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.UpdateAssetContract;return proto.protocol.UpdateAssetContract.deserializeBinaryFromReader(r,e)},proto.protocol.UpdateAssetContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setDescription(r);break;case 3:r=e.readBytes();t.setUrl(r);break;case 4:r=e.readInt64();t.setNewLimit(r);break;case 5:r=e.readInt64();t.setNewPublicLimit(r);break;default:e.skipField()}}return t},proto.protocol.UpdateAssetContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.UpdateAssetContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.UpdateAssetContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getDescription_asU8()).length>0&&e.writeBytes(2,r),(r=t.getUrl_asU8()).length>0&&e.writeBytes(3,r),0!==(r=t.getNewLimit())&&e.writeInt64(4,r),0!==(r=t.getNewPublicLimit())&&e.writeInt64(5,r)},proto.protocol.UpdateAssetContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.UpdateAssetContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.UpdateAssetContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.UpdateAssetContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.UpdateAssetContract.prototype.getDescription=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.UpdateAssetContract.prototype.getDescription_asB64=function(){return o.Message.bytesAsB64(this.getDescription())},proto.protocol.UpdateAssetContract.prototype.getDescription_asU8=function(){return o.Message.bytesAsU8(this.getDescription())},proto.protocol.UpdateAssetContract.prototype.setDescription=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.UpdateAssetContract.prototype.getUrl=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.UpdateAssetContract.prototype.getUrl_asB64=function(){return o.Message.bytesAsB64(this.getUrl())},proto.protocol.UpdateAssetContract.prototype.getUrl_asU8=function(){return o.Message.bytesAsU8(this.getUrl())},proto.protocol.UpdateAssetContract.prototype.setUrl=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.UpdateAssetContract.prototype.getNewLimit=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.UpdateAssetContract.prototype.setNewLimit=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.UpdateAssetContract.prototype.getNewPublicLimit=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.UpdateAssetContract.prototype.setNewPublicLimit=function(t){return o.Message.setProto3IntField(this,5,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ParticipateAssetIssueContract.prototype.toObject=function(t){return proto.protocol.ParticipateAssetIssueContract.toObject(t,this)},proto.protocol.ParticipateAssetIssueContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),toAddress:e.getToAddress_asB64(),assetName:e.getAssetName_asB64(),amount:o.Message.getFieldWithDefault(e,4,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.ParticipateAssetIssueContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ParticipateAssetIssueContract;return proto.protocol.ParticipateAssetIssueContract.deserializeBinaryFromReader(r,e)},proto.protocol.ParticipateAssetIssueContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setToAddress(r);break;case 3:r=e.readBytes();t.setAssetName(r);break;case 4:r=e.readInt64();t.setAmount(r);break;default:e.skipField()}}return t},proto.protocol.ParticipateAssetIssueContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ParticipateAssetIssueContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ParticipateAssetIssueContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getToAddress_asU8()).length>0&&e.writeBytes(2,r),(r=t.getAssetName_asU8()).length>0&&e.writeBytes(3,r),0!==(r=t.getAmount())&&e.writeInt64(4,r)},proto.protocol.ParticipateAssetIssueContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ParticipateAssetIssueContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ParticipateAssetIssueContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ParticipateAssetIssueContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ParticipateAssetIssueContract.prototype.getToAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.ParticipateAssetIssueContract.prototype.getToAddress_asB64=function(){return o.Message.bytesAsB64(this.getToAddress())},proto.protocol.ParticipateAssetIssueContract.prototype.getToAddress_asU8=function(){return o.Message.bytesAsU8(this.getToAddress())},proto.protocol.ParticipateAssetIssueContract.prototype.setToAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.ParticipateAssetIssueContract.prototype.getAssetName=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.ParticipateAssetIssueContract.prototype.getAssetName_asB64=function(){return o.Message.bytesAsB64(this.getAssetName())},proto.protocol.ParticipateAssetIssueContract.prototype.getAssetName_asU8=function(){return o.Message.bytesAsU8(this.getAssetName())},proto.protocol.ParticipateAssetIssueContract.prototype.setAssetName=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.ParticipateAssetIssueContract.prototype.getAmount=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.ParticipateAssetIssueContract.prototype.setAmount=function(t){return o.Message.setProto3IntField(this,4,t)},n.object.extend(e,proto.protocol)},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null);n.exportSymbol("proto.protocol.ClearABIContract",null,s),n.exportSymbol("proto.protocol.CreateSmartContract",null,s),n.exportSymbol("proto.protocol.SmartContract",null,s),n.exportSymbol("proto.protocol.SmartContract.ABI",null,s),n.exportSymbol("proto.protocol.SmartContract.ABI.Entry",null,s),n.exportSymbol("proto.protocol.SmartContract.ABI.Entry.EntryType",null,s),n.exportSymbol("proto.protocol.SmartContract.ABI.Entry.Param",null,s),n.exportSymbol("proto.protocol.SmartContract.ABI.Entry.StateMutabilityType",null,s),n.exportSymbol("proto.protocol.SmartContractDataWrapper",null,s),n.exportSymbol("proto.protocol.TriggerSmartContract",null,s),n.exportSymbol("proto.protocol.UpdateEnergyLimitContract",null,s),n.exportSymbol("proto.protocol.UpdateSettingContract",null,s),proto.protocol.SmartContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.SmartContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.SmartContract.displayName="proto.protocol.SmartContract"),proto.protocol.SmartContract.ABI=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.SmartContract.ABI.repeatedFields_,null)},n.inherits(proto.protocol.SmartContract.ABI,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.SmartContract.ABI.displayName="proto.protocol.SmartContract.ABI"),proto.protocol.SmartContract.ABI.Entry=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.SmartContract.ABI.Entry.repeatedFields_,null)},n.inherits(proto.protocol.SmartContract.ABI.Entry,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.SmartContract.ABI.Entry.displayName="proto.protocol.SmartContract.ABI.Entry"),proto.protocol.SmartContract.ABI.Entry.Param=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.SmartContract.ABI.Entry.Param,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.SmartContract.ABI.Entry.Param.displayName="proto.protocol.SmartContract.ABI.Entry.Param"),proto.protocol.CreateSmartContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.CreateSmartContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.CreateSmartContract.displayName="proto.protocol.CreateSmartContract"),proto.protocol.TriggerSmartContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.TriggerSmartContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.TriggerSmartContract.displayName="proto.protocol.TriggerSmartContract"),proto.protocol.ClearABIContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ClearABIContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ClearABIContract.displayName="proto.protocol.ClearABIContract"),proto.protocol.UpdateSettingContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.UpdateSettingContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.UpdateSettingContract.displayName="proto.protocol.UpdateSettingContract"),proto.protocol.UpdateEnergyLimitContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.UpdateEnergyLimitContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.UpdateEnergyLimitContract.displayName="proto.protocol.UpdateEnergyLimitContract"),proto.protocol.SmartContractDataWrapper=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.SmartContractDataWrapper,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.SmartContractDataWrapper.displayName="proto.protocol.SmartContractDataWrapper"),o.Message.GENERATE_TO_OBJECT&&(proto.protocol.SmartContract.prototype.toObject=function(t){return proto.protocol.SmartContract.toObject(t,this)},proto.protocol.SmartContract.toObject=function(t,e){var r,n={originAddress:e.getOriginAddress_asB64(),contractAddress:e.getContractAddress_asB64(),abi:(r=e.getAbi())&&proto.protocol.SmartContract.ABI.toObject(t,r),bytecode:e.getBytecode_asB64(),callValue:o.Message.getFieldWithDefault(e,5,0),consumeUserResourcePercent:o.Message.getFieldWithDefault(e,6,0),name:o.Message.getFieldWithDefault(e,7,""),originEnergyLimit:o.Message.getFieldWithDefault(e,8,0),codeHash:e.getCodeHash_asB64(),trxHash:e.getTrxHash_asB64()};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.SmartContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.SmartContract;return proto.protocol.SmartContract.deserializeBinaryFromReader(r,e)},proto.protocol.SmartContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOriginAddress(r);break;case 2:r=e.readBytes();t.setContractAddress(r);break;case 3:r=new proto.protocol.SmartContract.ABI;e.readMessage(r,proto.protocol.SmartContract.ABI.deserializeBinaryFromReader),t.setAbi(r);break;case 4:r=e.readBytes();t.setBytecode(r);break;case 5:r=e.readInt64();t.setCallValue(r);break;case 6:r=e.readInt64();t.setConsumeUserResourcePercent(r);break;case 7:r=e.readString();t.setName(r);break;case 8:r=e.readInt64();t.setOriginEnergyLimit(r);break;case 9:r=e.readBytes();t.setCodeHash(r);break;case 10:r=e.readBytes();t.setTrxHash(r);break;default:e.skipField()}}return t},proto.protocol.SmartContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.SmartContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.SmartContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOriginAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getContractAddress_asU8()).length>0&&e.writeBytes(2,r),null!=(r=t.getAbi())&&e.writeMessage(3,r,proto.protocol.SmartContract.ABI.serializeBinaryToWriter),(r=t.getBytecode_asU8()).length>0&&e.writeBytes(4,r),0!==(r=t.getCallValue())&&e.writeInt64(5,r),0!==(r=t.getConsumeUserResourcePercent())&&e.writeInt64(6,r),(r=t.getName()).length>0&&e.writeString(7,r),0!==(r=t.getOriginEnergyLimit())&&e.writeInt64(8,r),(r=t.getCodeHash_asU8()).length>0&&e.writeBytes(9,r),(r=t.getTrxHash_asU8()).length>0&&e.writeBytes(10,r)},proto.protocol.SmartContract.ABI.repeatedFields_=[1],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.SmartContract.ABI.prototype.toObject=function(t){return proto.protocol.SmartContract.ABI.toObject(t,this)},proto.protocol.SmartContract.ABI.toObject=function(t,e){var r={entrysList:o.Message.toObjectList(e.getEntrysList(),proto.protocol.SmartContract.ABI.Entry.toObject,t)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.SmartContract.ABI.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.SmartContract.ABI;return proto.protocol.SmartContract.ABI.deserializeBinaryFromReader(r,e)},proto.protocol.SmartContract.ABI.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=new proto.protocol.SmartContract.ABI.Entry;e.readMessage(r,proto.protocol.SmartContract.ABI.Entry.deserializeBinaryFromReader),t.addEntrys(r);break;default:e.skipField()}}return t},proto.protocol.SmartContract.ABI.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.SmartContract.ABI.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.SmartContract.ABI.serializeBinaryToWriter=function(t,e){var r;(r=t.getEntrysList()).length>0&&e.writeRepeatedMessage(1,r,proto.protocol.SmartContract.ABI.Entry.serializeBinaryToWriter)},proto.protocol.SmartContract.ABI.Entry.repeatedFields_=[4,5],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.SmartContract.ABI.Entry.prototype.toObject=function(t){return proto.protocol.SmartContract.ABI.Entry.toObject(t,this)},proto.protocol.SmartContract.ABI.Entry.toObject=function(t,e){var r={anonymous:o.Message.getBooleanFieldWithDefault(e,1,!1),constant:o.Message.getBooleanFieldWithDefault(e,2,!1),name:o.Message.getFieldWithDefault(e,3,""),inputsList:o.Message.toObjectList(e.getInputsList(),proto.protocol.SmartContract.ABI.Entry.Param.toObject,t),outputsList:o.Message.toObjectList(e.getOutputsList(),proto.protocol.SmartContract.ABI.Entry.Param.toObject,t),type:o.Message.getFieldWithDefault(e,6,0),payable:o.Message.getBooleanFieldWithDefault(e,7,!1),statemutability:o.Message.getFieldWithDefault(e,8,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.SmartContract.ABI.Entry.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.SmartContract.ABI.Entry;return proto.protocol.SmartContract.ABI.Entry.deserializeBinaryFromReader(r,e)},proto.protocol.SmartContract.ABI.Entry.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBool();t.setAnonymous(r);break;case 2:r=e.readBool();t.setConstant(r);break;case 3:r=e.readString();t.setName(r);break;case 4:r=new proto.protocol.SmartContract.ABI.Entry.Param;e.readMessage(r,proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader),t.addInputs(r);break;case 5:r=new proto.protocol.SmartContract.ABI.Entry.Param;e.readMessage(r,proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader),t.addOutputs(r);break;case 6:r=e.readEnum();t.setType(r);break;case 7:r=e.readBool();t.setPayable(r);break;case 8:r=e.readEnum();t.setStatemutability(r);break;default:e.skipField()}}return t},proto.protocol.SmartContract.ABI.Entry.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.SmartContract.ABI.Entry.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.SmartContract.ABI.Entry.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getAnonymous())&&e.writeBool(1,r),(r=t.getConstant())&&e.writeBool(2,r),(r=t.getName()).length>0&&e.writeString(3,r),(r=t.getInputsList()).length>0&&e.writeRepeatedMessage(4,r,proto.protocol.SmartContract.ABI.Entry.Param.serializeBinaryToWriter),(r=t.getOutputsList()).length>0&&e.writeRepeatedMessage(5,r,proto.protocol.SmartContract.ABI.Entry.Param.serializeBinaryToWriter),0!==(r=t.getType())&&e.writeEnum(6,r),(r=t.getPayable())&&e.writeBool(7,r),0!==(r=t.getStatemutability())&&e.writeEnum(8,r)},proto.protocol.SmartContract.ABI.Entry.EntryType={UNKNOWNENTRYTYPE:0,CONSTRUCTOR:1,FUNCTION:2,EVENT:3,FALLBACK:4,RECEIVE:5,ERROR:6},proto.protocol.SmartContract.ABI.Entry.StateMutabilityType={UNKNOWNMUTABILITYTYPE:0,PURE:1,VIEW:2,NONPAYABLE:3,PAYABLE:4},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.SmartContract.ABI.Entry.Param.prototype.toObject=function(t){return proto.protocol.SmartContract.ABI.Entry.Param.toObject(t,this)},proto.protocol.SmartContract.ABI.Entry.Param.toObject=function(t,e){var r={indexed:o.Message.getBooleanFieldWithDefault(e,1,!1),name:o.Message.getFieldWithDefault(e,2,""),type:o.Message.getFieldWithDefault(e,3,"")};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.SmartContract.ABI.Entry.Param;return proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader(r,e)},proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBool();t.setIndexed(r);break;case 2:r=e.readString();t.setName(r);break;case 3:r=e.readString();t.setType(r);break;default:e.skipField()}}return t},proto.protocol.SmartContract.ABI.Entry.Param.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.SmartContract.ABI.Entry.Param.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.SmartContract.ABI.Entry.Param.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getIndexed())&&e.writeBool(1,r),(r=t.getName()).length>0&&e.writeString(2,r),(r=t.getType()).length>0&&e.writeString(3,r)},proto.protocol.SmartContract.ABI.Entry.Param.prototype.getIndexed=function(){return o.Message.getBooleanFieldWithDefault(this,1,!1)},proto.protocol.SmartContract.ABI.Entry.Param.prototype.setIndexed=function(t){return o.Message.setProto3BooleanField(this,1,t)},proto.protocol.SmartContract.ABI.Entry.Param.prototype.getName=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.SmartContract.ABI.Entry.Param.prototype.setName=function(t){return o.Message.setProto3StringField(this,2,t)},proto.protocol.SmartContract.ABI.Entry.Param.prototype.getType=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.SmartContract.ABI.Entry.Param.prototype.setType=function(t){return o.Message.setProto3StringField(this,3,t)},proto.protocol.SmartContract.ABI.Entry.prototype.getAnonymous=function(){return o.Message.getBooleanFieldWithDefault(this,1,!1)},proto.protocol.SmartContract.ABI.Entry.prototype.setAnonymous=function(t){return o.Message.setProto3BooleanField(this,1,t)},proto.protocol.SmartContract.ABI.Entry.prototype.getConstant=function(){return o.Message.getBooleanFieldWithDefault(this,2,!1)},proto.protocol.SmartContract.ABI.Entry.prototype.setConstant=function(t){return o.Message.setProto3BooleanField(this,2,t)},proto.protocol.SmartContract.ABI.Entry.prototype.getName=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.SmartContract.ABI.Entry.prototype.setName=function(t){return o.Message.setProto3StringField(this,3,t)},proto.protocol.SmartContract.ABI.Entry.prototype.getInputsList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.SmartContract.ABI.Entry.Param,4)},proto.protocol.SmartContract.ABI.Entry.prototype.setInputsList=function(t){return o.Message.setRepeatedWrapperField(this,4,t)},proto.protocol.SmartContract.ABI.Entry.prototype.addInputs=function(t,e){return o.Message.addToRepeatedWrapperField(this,4,t,proto.protocol.SmartContract.ABI.Entry.Param,e)},proto.protocol.SmartContract.ABI.Entry.prototype.clearInputsList=function(){return this.setInputsList([])},proto.protocol.SmartContract.ABI.Entry.prototype.getOutputsList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.SmartContract.ABI.Entry.Param,5)},proto.protocol.SmartContract.ABI.Entry.prototype.setOutputsList=function(t){return o.Message.setRepeatedWrapperField(this,5,t)},proto.protocol.SmartContract.ABI.Entry.prototype.addOutputs=function(t,e){return o.Message.addToRepeatedWrapperField(this,5,t,proto.protocol.SmartContract.ABI.Entry.Param,e)},proto.protocol.SmartContract.ABI.Entry.prototype.clearOutputsList=function(){return this.setOutputsList([])},proto.protocol.SmartContract.ABI.Entry.prototype.getType=function(){return o.Message.getFieldWithDefault(this,6,0)},proto.protocol.SmartContract.ABI.Entry.prototype.setType=function(t){return o.Message.setProto3EnumField(this,6,t)},proto.protocol.SmartContract.ABI.Entry.prototype.getPayable=function(){return o.Message.getBooleanFieldWithDefault(this,7,!1)},proto.protocol.SmartContract.ABI.Entry.prototype.setPayable=function(t){return o.Message.setProto3BooleanField(this,7,t)},proto.protocol.SmartContract.ABI.Entry.prototype.getStatemutability=function(){return o.Message.getFieldWithDefault(this,8,0)},proto.protocol.SmartContract.ABI.Entry.prototype.setStatemutability=function(t){return o.Message.setProto3EnumField(this,8,t)},proto.protocol.SmartContract.ABI.prototype.getEntrysList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.SmartContract.ABI.Entry,1)},proto.protocol.SmartContract.ABI.prototype.setEntrysList=function(t){return o.Message.setRepeatedWrapperField(this,1,t)},proto.protocol.SmartContract.ABI.prototype.addEntrys=function(t,e){return o.Message.addToRepeatedWrapperField(this,1,t,proto.protocol.SmartContract.ABI.Entry,e)},proto.protocol.SmartContract.ABI.prototype.clearEntrysList=function(){return this.setEntrysList([])},proto.protocol.SmartContract.prototype.getOriginAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.SmartContract.prototype.getOriginAddress_asB64=function(){return o.Message.bytesAsB64(this.getOriginAddress())},proto.protocol.SmartContract.prototype.getOriginAddress_asU8=function(){return o.Message.bytesAsU8(this.getOriginAddress())},proto.protocol.SmartContract.prototype.setOriginAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.SmartContract.prototype.getContractAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.SmartContract.prototype.getContractAddress_asB64=function(){return o.Message.bytesAsB64(this.getContractAddress())},proto.protocol.SmartContract.prototype.getContractAddress_asU8=function(){return o.Message.bytesAsU8(this.getContractAddress())},proto.protocol.SmartContract.prototype.setContractAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.SmartContract.prototype.getAbi=function(){return o.Message.getWrapperField(this,proto.protocol.SmartContract.ABI,3)},proto.protocol.SmartContract.prototype.setAbi=function(t){return o.Message.setWrapperField(this,3,t)},proto.protocol.SmartContract.prototype.clearAbi=function(){return this.setAbi(void 0)},proto.protocol.SmartContract.prototype.hasAbi=function(){return null!=o.Message.getField(this,3)},proto.protocol.SmartContract.prototype.getBytecode=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.SmartContract.prototype.getBytecode_asB64=function(){return o.Message.bytesAsB64(this.getBytecode())},proto.protocol.SmartContract.prototype.getBytecode_asU8=function(){return o.Message.bytesAsU8(this.getBytecode())},proto.protocol.SmartContract.prototype.setBytecode=function(t){return o.Message.setProto3BytesField(this,4,t)},proto.protocol.SmartContract.prototype.getCallValue=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.SmartContract.prototype.setCallValue=function(t){return o.Message.setProto3IntField(this,5,t)},proto.protocol.SmartContract.prototype.getConsumeUserResourcePercent=function(){return o.Message.getFieldWithDefault(this,6,0)},proto.protocol.SmartContract.prototype.setConsumeUserResourcePercent=function(t){return o.Message.setProto3IntField(this,6,t)},proto.protocol.SmartContract.prototype.getName=function(){return o.Message.getFieldWithDefault(this,7,"")},proto.protocol.SmartContract.prototype.setName=function(t){return o.Message.setProto3StringField(this,7,t)},proto.protocol.SmartContract.prototype.getOriginEnergyLimit=function(){return o.Message.getFieldWithDefault(this,8,0)},proto.protocol.SmartContract.prototype.setOriginEnergyLimit=function(t){return o.Message.setProto3IntField(this,8,t)},proto.protocol.SmartContract.prototype.getCodeHash=function(){return o.Message.getFieldWithDefault(this,9,"")},proto.protocol.SmartContract.prototype.getCodeHash_asB64=function(){return o.Message.bytesAsB64(this.getCodeHash())},proto.protocol.SmartContract.prototype.getCodeHash_asU8=function(){return o.Message.bytesAsU8(this.getCodeHash())},proto.protocol.SmartContract.prototype.setCodeHash=function(t){return o.Message.setProto3BytesField(this,9,t)},proto.protocol.SmartContract.prototype.getTrxHash=function(){return o.Message.getFieldWithDefault(this,10,"")},proto.protocol.SmartContract.prototype.getTrxHash_asB64=function(){return o.Message.bytesAsB64(this.getTrxHash())},proto.protocol.SmartContract.prototype.getTrxHash_asU8=function(){return o.Message.bytesAsU8(this.getTrxHash())},proto.protocol.SmartContract.prototype.setTrxHash=function(t){return o.Message.setProto3BytesField(this,10,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.CreateSmartContract.prototype.toObject=function(t){return proto.protocol.CreateSmartContract.toObject(t,this)},proto.protocol.CreateSmartContract.toObject=function(t,e){var r,n={ownerAddress:e.getOwnerAddress_asB64(),newContract:(r=e.getNewContract())&&proto.protocol.SmartContract.toObject(t,r),callTokenValue:o.Message.getFieldWithDefault(e,3,0),tokenId:o.Message.getFieldWithDefault(e,4,0)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.CreateSmartContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.CreateSmartContract;return proto.protocol.CreateSmartContract.deserializeBinaryFromReader(r,e)},proto.protocol.CreateSmartContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=new proto.protocol.SmartContract;e.readMessage(r,proto.protocol.SmartContract.deserializeBinaryFromReader),t.setNewContract(r);break;case 3:r=e.readInt64();t.setCallTokenValue(r);break;case 4:r=e.readInt64();t.setTokenId(r);break;default:e.skipField()}}return t},proto.protocol.CreateSmartContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.CreateSmartContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.CreateSmartContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),null!=(r=t.getNewContract())&&e.writeMessage(2,r,proto.protocol.SmartContract.serializeBinaryToWriter),0!==(r=t.getCallTokenValue())&&e.writeInt64(3,r),0!==(r=t.getTokenId())&&e.writeInt64(4,r)},proto.protocol.CreateSmartContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.CreateSmartContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.CreateSmartContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.CreateSmartContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.CreateSmartContract.prototype.getNewContract=function(){return o.Message.getWrapperField(this,proto.protocol.SmartContract,2)},proto.protocol.CreateSmartContract.prototype.setNewContract=function(t){return o.Message.setWrapperField(this,2,t)},proto.protocol.CreateSmartContract.prototype.clearNewContract=function(){return this.setNewContract(void 0)},proto.protocol.CreateSmartContract.prototype.hasNewContract=function(){return null!=o.Message.getField(this,2)},proto.protocol.CreateSmartContract.prototype.getCallTokenValue=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.CreateSmartContract.prototype.setCallTokenValue=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.CreateSmartContract.prototype.getTokenId=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.CreateSmartContract.prototype.setTokenId=function(t){return o.Message.setProto3IntField(this,4,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.TriggerSmartContract.prototype.toObject=function(t){return proto.protocol.TriggerSmartContract.toObject(t,this)},proto.protocol.TriggerSmartContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),contractAddress:e.getContractAddress_asB64(),callValue:o.Message.getFieldWithDefault(e,3,0),data:e.getData_asB64(),callTokenValue:o.Message.getFieldWithDefault(e,5,0),tokenId:o.Message.getFieldWithDefault(e,6,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.TriggerSmartContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.TriggerSmartContract;return proto.protocol.TriggerSmartContract.deserializeBinaryFromReader(r,e)},proto.protocol.TriggerSmartContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setContractAddress(r);break;case 3:r=e.readInt64();t.setCallValue(r);break;case 4:r=e.readBytes();t.setData(r);break;case 5:r=e.readInt64();t.setCallTokenValue(r);break;case 6:r=e.readInt64();t.setTokenId(r);break;default:e.skipField()}}return t},proto.protocol.TriggerSmartContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.TriggerSmartContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.TriggerSmartContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getContractAddress_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getCallValue())&&e.writeInt64(3,r),(r=t.getData_asU8()).length>0&&e.writeBytes(4,r),0!==(r=t.getCallTokenValue())&&e.writeInt64(5,r),0!==(r=t.getTokenId())&&e.writeInt64(6,r)},proto.protocol.TriggerSmartContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.TriggerSmartContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.TriggerSmartContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.TriggerSmartContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.TriggerSmartContract.prototype.getContractAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.TriggerSmartContract.prototype.getContractAddress_asB64=function(){return o.Message.bytesAsB64(this.getContractAddress())},proto.protocol.TriggerSmartContract.prototype.getContractAddress_asU8=function(){return o.Message.bytesAsU8(this.getContractAddress())},proto.protocol.TriggerSmartContract.prototype.setContractAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.TriggerSmartContract.prototype.getCallValue=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.TriggerSmartContract.prototype.setCallValue=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.TriggerSmartContract.prototype.getData=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.TriggerSmartContract.prototype.getData_asB64=function(){return o.Message.bytesAsB64(this.getData())},proto.protocol.TriggerSmartContract.prototype.getData_asU8=function(){return o.Message.bytesAsU8(this.getData())},proto.protocol.TriggerSmartContract.prototype.setData=function(t){return o.Message.setProto3BytesField(this,4,t)},proto.protocol.TriggerSmartContract.prototype.getCallTokenValue=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.TriggerSmartContract.prototype.setCallTokenValue=function(t){return o.Message.setProto3IntField(this,5,t)},proto.protocol.TriggerSmartContract.prototype.getTokenId=function(){return o.Message.getFieldWithDefault(this,6,0)},proto.protocol.TriggerSmartContract.prototype.setTokenId=function(t){return o.Message.setProto3IntField(this,6,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ClearABIContract.prototype.toObject=function(t){return proto.protocol.ClearABIContract.toObject(t,this)},proto.protocol.ClearABIContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),contractAddress:e.getContractAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.ClearABIContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ClearABIContract;return proto.protocol.ClearABIContract.deserializeBinaryFromReader(r,e)},proto.protocol.ClearABIContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setContractAddress(r);break;default:e.skipField()}}return t},proto.protocol.ClearABIContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ClearABIContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ClearABIContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getContractAddress_asU8()).length>0&&e.writeBytes(2,r)},proto.protocol.ClearABIContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ClearABIContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ClearABIContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ClearABIContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ClearABIContract.prototype.getContractAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.ClearABIContract.prototype.getContractAddress_asB64=function(){return o.Message.bytesAsB64(this.getContractAddress())},proto.protocol.ClearABIContract.prototype.getContractAddress_asU8=function(){return o.Message.bytesAsU8(this.getContractAddress())},proto.protocol.ClearABIContract.prototype.setContractAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.UpdateSettingContract.prototype.toObject=function(t){return proto.protocol.UpdateSettingContract.toObject(t,this)},proto.protocol.UpdateSettingContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),contractAddress:e.getContractAddress_asB64(),consumeUserResourcePercent:o.Message.getFieldWithDefault(e,3,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.UpdateSettingContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.UpdateSettingContract;return proto.protocol.UpdateSettingContract.deserializeBinaryFromReader(r,e)},proto.protocol.UpdateSettingContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setContractAddress(r);break;case 3:r=e.readInt64();t.setConsumeUserResourcePercent(r);break;default:e.skipField()}}return t},proto.protocol.UpdateSettingContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.UpdateSettingContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.UpdateSettingContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getContractAddress_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getConsumeUserResourcePercent())&&e.writeInt64(3,r)},proto.protocol.UpdateSettingContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.UpdateSettingContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.UpdateSettingContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.UpdateSettingContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.UpdateSettingContract.prototype.getContractAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.UpdateSettingContract.prototype.getContractAddress_asB64=function(){return o.Message.bytesAsB64(this.getContractAddress())},proto.protocol.UpdateSettingContract.prototype.getContractAddress_asU8=function(){return o.Message.bytesAsU8(this.getContractAddress())},proto.protocol.UpdateSettingContract.prototype.setContractAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.UpdateSettingContract.prototype.getConsumeUserResourcePercent=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.UpdateSettingContract.prototype.setConsumeUserResourcePercent=function(t){return o.Message.setProto3IntField(this,3,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.UpdateEnergyLimitContract.prototype.toObject=function(t){return proto.protocol.UpdateEnergyLimitContract.toObject(t,this)},proto.protocol.UpdateEnergyLimitContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),contractAddress:e.getContractAddress_asB64(),originEnergyLimit:o.Message.getFieldWithDefault(e,3,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.UpdateEnergyLimitContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.UpdateEnergyLimitContract;return proto.protocol.UpdateEnergyLimitContract.deserializeBinaryFromReader(r,e)},proto.protocol.UpdateEnergyLimitContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setContractAddress(r);break;case 3:r=e.readInt64();t.setOriginEnergyLimit(r);break;default:e.skipField()}}return t},proto.protocol.UpdateEnergyLimitContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.UpdateEnergyLimitContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.UpdateEnergyLimitContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getContractAddress_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getOriginEnergyLimit())&&e.writeInt64(3,r)},proto.protocol.UpdateEnergyLimitContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.UpdateEnergyLimitContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.UpdateEnergyLimitContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.UpdateEnergyLimitContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.UpdateEnergyLimitContract.prototype.getContractAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.UpdateEnergyLimitContract.prototype.getContractAddress_asB64=function(){return o.Message.bytesAsB64(this.getContractAddress())},proto.protocol.UpdateEnergyLimitContract.prototype.getContractAddress_asU8=function(){return o.Message.bytesAsU8(this.getContractAddress())},proto.protocol.UpdateEnergyLimitContract.prototype.setContractAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.UpdateEnergyLimitContract.prototype.getOriginEnergyLimit=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.UpdateEnergyLimitContract.prototype.setOriginEnergyLimit=function(t){return o.Message.setProto3IntField(this,3,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.SmartContractDataWrapper.prototype.toObject=function(t){return proto.protocol.SmartContractDataWrapper.toObject(t,this)},proto.protocol.SmartContractDataWrapper.toObject=function(t,e){var r,o={smartContract:(r=e.getSmartContract())&&proto.protocol.SmartContract.toObject(t,r),runtimecode:e.getRuntimecode_asB64()};return t&&(o.$jspbMessageInstance=e),o}),proto.protocol.SmartContractDataWrapper.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.SmartContractDataWrapper;return proto.protocol.SmartContractDataWrapper.deserializeBinaryFromReader(r,e)},proto.protocol.SmartContractDataWrapper.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=new proto.protocol.SmartContract;e.readMessage(r,proto.protocol.SmartContract.deserializeBinaryFromReader),t.setSmartContract(r);break;case 2:r=e.readBytes();t.setRuntimecode(r);break;default:e.skipField()}}return t},proto.protocol.SmartContractDataWrapper.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.SmartContractDataWrapper.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.SmartContractDataWrapper.serializeBinaryToWriter=function(t,e){var r=void 0;null!=(r=t.getSmartContract())&&e.writeMessage(1,r,proto.protocol.SmartContract.serializeBinaryToWriter),(r=t.getRuntimecode_asU8()).length>0&&e.writeBytes(2,r)},proto.protocol.SmartContractDataWrapper.prototype.getSmartContract=function(){return o.Message.getWrapperField(this,proto.protocol.SmartContract,1)},proto.protocol.SmartContractDataWrapper.prototype.setSmartContract=function(t){return o.Message.setWrapperField(this,1,t)},proto.protocol.SmartContractDataWrapper.prototype.clearSmartContract=function(){return this.setSmartContract(void 0)},proto.protocol.SmartContractDataWrapper.prototype.hasSmartContract=function(){return null!=o.Message.getField(this,1)},proto.protocol.SmartContractDataWrapper.prototype.getRuntimecode=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.SmartContractDataWrapper.prototype.getRuntimecode_asB64=function(){return o.Message.bytesAsB64(this.getRuntimecode())},proto.protocol.SmartContractDataWrapper.prototype.getRuntimecode_asU8=function(){return o.Message.bytesAsU8(this.getRuntimecode())},proto.protocol.SmartContractDataWrapper.prototype.setRuntimecode=function(t){return o.Message.setProto3BytesField(this,2,t)},n.object.extend(e,proto.protocol)},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null);n.exportSymbol("proto.protocol.VoteWitnessContract",null,s),n.exportSymbol("proto.protocol.VoteWitnessContract.Vote",null,s),n.exportSymbol("proto.protocol.WitnessCreateContract",null,s),n.exportSymbol("proto.protocol.WitnessUpdateContract",null,s),proto.protocol.WitnessCreateContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.WitnessCreateContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.WitnessCreateContract.displayName="proto.protocol.WitnessCreateContract"),proto.protocol.WitnessUpdateContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.WitnessUpdateContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.WitnessUpdateContract.displayName="proto.protocol.WitnessUpdateContract"),proto.protocol.VoteWitnessContract=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.VoteWitnessContract.repeatedFields_,null)},n.inherits(proto.protocol.VoteWitnessContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.VoteWitnessContract.displayName="proto.protocol.VoteWitnessContract"),proto.protocol.VoteWitnessContract.Vote=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.VoteWitnessContract.Vote,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.VoteWitnessContract.Vote.displayName="proto.protocol.VoteWitnessContract.Vote"),o.Message.GENERATE_TO_OBJECT&&(proto.protocol.WitnessCreateContract.prototype.toObject=function(t){return proto.protocol.WitnessCreateContract.toObject(t,this)},proto.protocol.WitnessCreateContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),url:e.getUrl_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.WitnessCreateContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.WitnessCreateContract;return proto.protocol.WitnessCreateContract.deserializeBinaryFromReader(r,e)},proto.protocol.WitnessCreateContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setUrl(r);break;default:e.skipField()}}return t},proto.protocol.WitnessCreateContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.WitnessCreateContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.WitnessCreateContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getUrl_asU8()).length>0&&e.writeBytes(2,r)},proto.protocol.WitnessCreateContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.WitnessCreateContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.WitnessCreateContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.WitnessCreateContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.WitnessCreateContract.prototype.getUrl=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.WitnessCreateContract.prototype.getUrl_asB64=function(){return o.Message.bytesAsB64(this.getUrl())},proto.protocol.WitnessCreateContract.prototype.getUrl_asU8=function(){return o.Message.bytesAsU8(this.getUrl())},proto.protocol.WitnessCreateContract.prototype.setUrl=function(t){return o.Message.setProto3BytesField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.WitnessUpdateContract.prototype.toObject=function(t){return proto.protocol.WitnessUpdateContract.toObject(t,this)},proto.protocol.WitnessUpdateContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),updateUrl:e.getUpdateUrl_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.WitnessUpdateContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.WitnessUpdateContract;return proto.protocol.WitnessUpdateContract.deserializeBinaryFromReader(r,e)},proto.protocol.WitnessUpdateContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 12:r=e.readBytes();t.setUpdateUrl(r);break;default:e.skipField()}}return t},proto.protocol.WitnessUpdateContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.WitnessUpdateContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.WitnessUpdateContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getUpdateUrl_asU8()).length>0&&e.writeBytes(12,r)},proto.protocol.WitnessUpdateContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.WitnessUpdateContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.WitnessUpdateContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.WitnessUpdateContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.WitnessUpdateContract.prototype.getUpdateUrl=function(){return o.Message.getFieldWithDefault(this,12,"")},proto.protocol.WitnessUpdateContract.prototype.getUpdateUrl_asB64=function(){return o.Message.bytesAsB64(this.getUpdateUrl())},proto.protocol.WitnessUpdateContract.prototype.getUpdateUrl_asU8=function(){return o.Message.bytesAsU8(this.getUpdateUrl())},proto.protocol.WitnessUpdateContract.prototype.setUpdateUrl=function(t){return o.Message.setProto3BytesField(this,12,t)},proto.protocol.VoteWitnessContract.repeatedFields_=[2],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.VoteWitnessContract.prototype.toObject=function(t){return proto.protocol.VoteWitnessContract.toObject(t,this)},proto.protocol.VoteWitnessContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),votesList:o.Message.toObjectList(e.getVotesList(),proto.protocol.VoteWitnessContract.Vote.toObject,t),support:o.Message.getBooleanFieldWithDefault(e,3,!1)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.VoteWitnessContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.VoteWitnessContract;return proto.protocol.VoteWitnessContract.deserializeBinaryFromReader(r,e)},proto.protocol.VoteWitnessContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=new proto.protocol.VoteWitnessContract.Vote;e.readMessage(r,proto.protocol.VoteWitnessContract.Vote.deserializeBinaryFromReader),t.addVotes(r);break;case 3:r=e.readBool();t.setSupport(r);break;default:e.skipField()}}return t},proto.protocol.VoteWitnessContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.VoteWitnessContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.VoteWitnessContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getVotesList()).length>0&&e.writeRepeatedMessage(2,r,proto.protocol.VoteWitnessContract.Vote.serializeBinaryToWriter),(r=t.getSupport())&&e.writeBool(3,r)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.VoteWitnessContract.Vote.prototype.toObject=function(t){return proto.protocol.VoteWitnessContract.Vote.toObject(t,this)},proto.protocol.VoteWitnessContract.Vote.toObject=function(t,e){var r={voteAddress:e.getVoteAddress_asB64(),voteCount:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.VoteWitnessContract.Vote.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.VoteWitnessContract.Vote;return proto.protocol.VoteWitnessContract.Vote.deserializeBinaryFromReader(r,e)},proto.protocol.VoteWitnessContract.Vote.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setVoteAddress(r);break;case 2:r=e.readInt64();t.setVoteCount(r);break;default:e.skipField()}}return t},proto.protocol.VoteWitnessContract.Vote.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.VoteWitnessContract.Vote.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.VoteWitnessContract.Vote.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getVoteAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getVoteCount())&&e.writeInt64(2,r)},proto.protocol.VoteWitnessContract.Vote.prototype.getVoteAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.VoteWitnessContract.Vote.prototype.getVoteAddress_asB64=function(){return o.Message.bytesAsB64(this.getVoteAddress())},proto.protocol.VoteWitnessContract.Vote.prototype.getVoteAddress_asU8=function(){return o.Message.bytesAsU8(this.getVoteAddress())},proto.protocol.VoteWitnessContract.Vote.prototype.setVoteAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.VoteWitnessContract.Vote.prototype.getVoteCount=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.VoteWitnessContract.Vote.prototype.setVoteCount=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.VoteWitnessContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.VoteWitnessContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.VoteWitnessContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.VoteWitnessContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.VoteWitnessContract.prototype.getVotesList=function(){return o.Message.getRepeatedWrapperField(this,proto.protocol.VoteWitnessContract.Vote,2)},proto.protocol.VoteWitnessContract.prototype.setVotesList=function(t){return o.Message.setRepeatedWrapperField(this,2,t)},proto.protocol.VoteWitnessContract.prototype.addVotes=function(t,e){return o.Message.addToRepeatedWrapperField(this,2,t,proto.protocol.VoteWitnessContract.Vote,e)},proto.protocol.VoteWitnessContract.prototype.clearVotesList=function(){return this.setVotesList([])},proto.protocol.VoteWitnessContract.prototype.getSupport=function(){return o.Message.getBooleanFieldWithDefault(this,3,!1)},proto.protocol.VoteWitnessContract.prototype.setSupport=function(t){return o.Message.setProto3BooleanField(this,3,t)},n.object.extend(e,proto.protocol)},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null);n.exportSymbol("proto.protocol.BuyStorageBytesContract",null,s),n.exportSymbol("proto.protocol.BuyStorageContract",null,s),n.exportSymbol("proto.protocol.SellStorageContract",null,s),n.exportSymbol("proto.protocol.UpdateBrokerageContract",null,s),proto.protocol.BuyStorageBytesContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.BuyStorageBytesContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.BuyStorageBytesContract.displayName="proto.protocol.BuyStorageBytesContract"),proto.protocol.BuyStorageContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.BuyStorageContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.BuyStorageContract.displayName="proto.protocol.BuyStorageContract"),proto.protocol.SellStorageContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.SellStorageContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.SellStorageContract.displayName="proto.protocol.SellStorageContract"),proto.protocol.UpdateBrokerageContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.UpdateBrokerageContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.UpdateBrokerageContract.displayName="proto.protocol.UpdateBrokerageContract"),o.Message.GENERATE_TO_OBJECT&&(proto.protocol.BuyStorageBytesContract.prototype.toObject=function(t){return proto.protocol.BuyStorageBytesContract.toObject(t,this)},proto.protocol.BuyStorageBytesContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),bytes:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.BuyStorageBytesContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.BuyStorageBytesContract;return proto.protocol.BuyStorageBytesContract.deserializeBinaryFromReader(r,e)},proto.protocol.BuyStorageBytesContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setBytes(r);break;default:e.skipField()}}return t},proto.protocol.BuyStorageBytesContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.BuyStorageBytesContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.BuyStorageBytesContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getBytes())&&e.writeInt64(2,r)},proto.protocol.BuyStorageBytesContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.BuyStorageBytesContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.BuyStorageBytesContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.BuyStorageBytesContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.BuyStorageBytesContract.prototype.getBytes=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.BuyStorageBytesContract.prototype.setBytes=function(t){return o.Message.setProto3IntField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.BuyStorageContract.prototype.toObject=function(t){return proto.protocol.BuyStorageContract.toObject(t,this)},proto.protocol.BuyStorageContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),quant:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.BuyStorageContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.BuyStorageContract;return proto.protocol.BuyStorageContract.deserializeBinaryFromReader(r,e)},proto.protocol.BuyStorageContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setQuant(r);break;default:e.skipField()}}return t},proto.protocol.BuyStorageContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.BuyStorageContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.BuyStorageContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getQuant())&&e.writeInt64(2,r)},proto.protocol.BuyStorageContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.BuyStorageContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.BuyStorageContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.BuyStorageContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.BuyStorageContract.prototype.getQuant=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.BuyStorageContract.prototype.setQuant=function(t){return o.Message.setProto3IntField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.SellStorageContract.prototype.toObject=function(t){return proto.protocol.SellStorageContract.toObject(t,this)},proto.protocol.SellStorageContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),storageBytes:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.SellStorageContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.SellStorageContract;return proto.protocol.SellStorageContract.deserializeBinaryFromReader(r,e)},proto.protocol.SellStorageContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setStorageBytes(r);break;default:e.skipField()}}return t},proto.protocol.SellStorageContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.SellStorageContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.SellStorageContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getStorageBytes())&&e.writeInt64(2,r)},proto.protocol.SellStorageContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.SellStorageContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.SellStorageContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.SellStorageContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.SellStorageContract.prototype.getStorageBytes=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.SellStorageContract.prototype.setStorageBytes=function(t){return o.Message.setProto3IntField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.UpdateBrokerageContract.prototype.toObject=function(t){return proto.protocol.UpdateBrokerageContract.toObject(t,this)},proto.protocol.UpdateBrokerageContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),brokerage:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.UpdateBrokerageContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.UpdateBrokerageContract;return proto.protocol.UpdateBrokerageContract.deserializeBinaryFromReader(r,e)},proto.protocol.UpdateBrokerageContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt32();t.setBrokerage(r);break;default:e.skipField()}}return t},proto.protocol.UpdateBrokerageContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.UpdateBrokerageContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.UpdateBrokerageContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getBrokerage())&&e.writeInt32(2,r)},proto.protocol.UpdateBrokerageContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.UpdateBrokerageContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.UpdateBrokerageContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.UpdateBrokerageContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.UpdateBrokerageContract.prototype.getBrokerage=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.UpdateBrokerageContract.prototype.setBrokerage=function(t){return o.Message.setProto3IntField(this,2,t)},n.object.extend(e,proto.protocol)},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null),a=r(20);n.object.extend(proto,a),n.exportSymbol("proto.protocol.AccountCreateContract",null,s),n.exportSymbol("proto.protocol.AccountPermissionUpdateContract",null,s),n.exportSymbol("proto.protocol.AccountUpdateContract",null,s),n.exportSymbol("proto.protocol.SetAccountIdContract",null,s),proto.protocol.AccountCreateContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.AccountCreateContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AccountCreateContract.displayName="proto.protocol.AccountCreateContract"),proto.protocol.AccountUpdateContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.AccountUpdateContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AccountUpdateContract.displayName="proto.protocol.AccountUpdateContract"),proto.protocol.SetAccountIdContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.SetAccountIdContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.SetAccountIdContract.displayName="proto.protocol.SetAccountIdContract"),proto.protocol.AccountPermissionUpdateContract=function(t){o.Message.initialize(this,t,0,-1,proto.protocol.AccountPermissionUpdateContract.repeatedFields_,null)},n.inherits(proto.protocol.AccountPermissionUpdateContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.AccountPermissionUpdateContract.displayName="proto.protocol.AccountPermissionUpdateContract"),o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AccountCreateContract.prototype.toObject=function(t){return proto.protocol.AccountCreateContract.toObject(t,this)},proto.protocol.AccountCreateContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),accountAddress:e.getAccountAddress_asB64(),type:o.Message.getFieldWithDefault(e,3,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.AccountCreateContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AccountCreateContract;return proto.protocol.AccountCreateContract.deserializeBinaryFromReader(r,e)},proto.protocol.AccountCreateContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setAccountAddress(r);break;case 3:r=e.readEnum();t.setType(r);break;default:e.skipField()}}return t},proto.protocol.AccountCreateContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AccountCreateContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AccountCreateContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getAccountAddress_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getType())&&e.writeEnum(3,r)},proto.protocol.AccountCreateContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.AccountCreateContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.AccountCreateContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.AccountCreateContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.AccountCreateContract.prototype.getAccountAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.AccountCreateContract.prototype.getAccountAddress_asB64=function(){return o.Message.bytesAsB64(this.getAccountAddress())},proto.protocol.AccountCreateContract.prototype.getAccountAddress_asU8=function(){return o.Message.bytesAsU8(this.getAccountAddress())},proto.protocol.AccountCreateContract.prototype.setAccountAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.AccountCreateContract.prototype.getType=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.AccountCreateContract.prototype.setType=function(t){return o.Message.setProto3EnumField(this,3,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AccountUpdateContract.prototype.toObject=function(t){return proto.protocol.AccountUpdateContract.toObject(t,this)},proto.protocol.AccountUpdateContract.toObject=function(t,e){var r={accountName:e.getAccountName_asB64(),ownerAddress:e.getOwnerAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.AccountUpdateContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AccountUpdateContract;return proto.protocol.AccountUpdateContract.deserializeBinaryFromReader(r,e)},proto.protocol.AccountUpdateContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setAccountName(r);break;case 2:r=e.readBytes();t.setOwnerAddress(r);break;default:e.skipField()}}return t},proto.protocol.AccountUpdateContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AccountUpdateContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AccountUpdateContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getAccountName_asU8()).length>0&&e.writeBytes(1,r),(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(2,r)},proto.protocol.AccountUpdateContract.prototype.getAccountName=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.AccountUpdateContract.prototype.getAccountName_asB64=function(){return o.Message.bytesAsB64(this.getAccountName())},proto.protocol.AccountUpdateContract.prototype.getAccountName_asU8=function(){return o.Message.bytesAsU8(this.getAccountName())},proto.protocol.AccountUpdateContract.prototype.setAccountName=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.AccountUpdateContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.AccountUpdateContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.AccountUpdateContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.AccountUpdateContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.SetAccountIdContract.prototype.toObject=function(t){return proto.protocol.SetAccountIdContract.toObject(t,this)},proto.protocol.SetAccountIdContract.toObject=function(t,e){var r={accountId:e.getAccountId_asB64(),ownerAddress:e.getOwnerAddress_asB64()};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.SetAccountIdContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.SetAccountIdContract;return proto.protocol.SetAccountIdContract.deserializeBinaryFromReader(r,e)},proto.protocol.SetAccountIdContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setAccountId(r);break;case 2:r=e.readBytes();t.setOwnerAddress(r);break;default:e.skipField()}}return t},proto.protocol.SetAccountIdContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.SetAccountIdContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.SetAccountIdContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getAccountId_asU8()).length>0&&e.writeBytes(1,r),(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(2,r)},proto.protocol.SetAccountIdContract.prototype.getAccountId=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.SetAccountIdContract.prototype.getAccountId_asB64=function(){return o.Message.bytesAsB64(this.getAccountId())},proto.protocol.SetAccountIdContract.prototype.getAccountId_asU8=function(){return o.Message.bytesAsU8(this.getAccountId())},proto.protocol.SetAccountIdContract.prototype.setAccountId=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.SetAccountIdContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.SetAccountIdContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.SetAccountIdContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.SetAccountIdContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.AccountPermissionUpdateContract.repeatedFields_=[4],o.Message.GENERATE_TO_OBJECT&&(proto.protocol.AccountPermissionUpdateContract.prototype.toObject=function(t){return proto.protocol.AccountPermissionUpdateContract.toObject(t,this)},proto.protocol.AccountPermissionUpdateContract.toObject=function(t,e){var r,n={ownerAddress:e.getOwnerAddress_asB64(),owner:(r=e.getOwner())&&a.Permission.toObject(t,r),witness:(r=e.getWitness())&&a.Permission.toObject(t,r),activesList:o.Message.toObjectList(e.getActivesList(),a.Permission.toObject,t)};return t&&(n.$jspbMessageInstance=e),n}),proto.protocol.AccountPermissionUpdateContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.AccountPermissionUpdateContract;return proto.protocol.AccountPermissionUpdateContract.deserializeBinaryFromReader(r,e)},proto.protocol.AccountPermissionUpdateContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=new a.Permission;e.readMessage(r,a.Permission.deserializeBinaryFromReader),t.setOwner(r);break;case 3:r=new a.Permission;e.readMessage(r,a.Permission.deserializeBinaryFromReader),t.setWitness(r);break;case 4:r=new a.Permission;e.readMessage(r,a.Permission.deserializeBinaryFromReader),t.addActives(r);break;default:e.skipField()}}return t},proto.protocol.AccountPermissionUpdateContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.AccountPermissionUpdateContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.AccountPermissionUpdateContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),null!=(r=t.getOwner())&&e.writeMessage(2,r,a.Permission.serializeBinaryToWriter),null!=(r=t.getWitness())&&e.writeMessage(3,r,a.Permission.serializeBinaryToWriter),(r=t.getActivesList()).length>0&&e.writeRepeatedMessage(4,r,a.Permission.serializeBinaryToWriter)},proto.protocol.AccountPermissionUpdateContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.AccountPermissionUpdateContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.AccountPermissionUpdateContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.AccountPermissionUpdateContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.AccountPermissionUpdateContract.prototype.getOwner=function(){return o.Message.getWrapperField(this,a.Permission,2)},proto.protocol.AccountPermissionUpdateContract.prototype.setOwner=function(t){return o.Message.setWrapperField(this,2,t)},proto.protocol.AccountPermissionUpdateContract.prototype.clearOwner=function(){return this.setOwner(void 0)},proto.protocol.AccountPermissionUpdateContract.prototype.hasOwner=function(){return null!=o.Message.getField(this,2)},proto.protocol.AccountPermissionUpdateContract.prototype.getWitness=function(){return o.Message.getWrapperField(this,a.Permission,3)},proto.protocol.AccountPermissionUpdateContract.prototype.setWitness=function(t){return o.Message.setWrapperField(this,3,t)},proto.protocol.AccountPermissionUpdateContract.prototype.clearWitness=function(){return this.setWitness(void 0)},proto.protocol.AccountPermissionUpdateContract.prototype.hasWitness=function(){return null!=o.Message.getField(this,3)},proto.protocol.AccountPermissionUpdateContract.prototype.getActivesList=function(){return o.Message.getRepeatedWrapperField(this,a.Permission,4)},proto.protocol.AccountPermissionUpdateContract.prototype.setActivesList=function(t){return o.Message.setRepeatedWrapperField(this,4,t)},proto.protocol.AccountPermissionUpdateContract.prototype.addActives=function(t,e){return o.Message.addToRepeatedWrapperField(this,4,t,proto.protocol.Permission,e)},proto.protocol.AccountPermissionUpdateContract.prototype.clearActivesList=function(){return this.setActivesList([])},n.object.extend(e,proto.protocol)},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null);n.exportSymbol("proto.protocol.ProposalApproveContract",null,s),n.exportSymbol("proto.protocol.ProposalCreateContract",null,s),n.exportSymbol("proto.protocol.ProposalDeleteContract",null,s),proto.protocol.ProposalApproveContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ProposalApproveContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ProposalApproveContract.displayName="proto.protocol.ProposalApproveContract"),proto.protocol.ProposalCreateContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ProposalCreateContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ProposalCreateContract.displayName="proto.protocol.ProposalCreateContract"),proto.protocol.ProposalDeleteContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ProposalDeleteContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ProposalDeleteContract.displayName="proto.protocol.ProposalDeleteContract"),o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ProposalApproveContract.prototype.toObject=function(t){return proto.protocol.ProposalApproveContract.toObject(t,this)},proto.protocol.ProposalApproveContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),proposalId:o.Message.getFieldWithDefault(e,2,0),isAddApproval:o.Message.getBooleanFieldWithDefault(e,3,!1)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.ProposalApproveContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ProposalApproveContract;return proto.protocol.ProposalApproveContract.deserializeBinaryFromReader(r,e)},proto.protocol.ProposalApproveContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setProposalId(r);break;case 3:r=e.readBool();t.setIsAddApproval(r);break;default:e.skipField()}}return t},proto.protocol.ProposalApproveContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ProposalApproveContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ProposalApproveContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getProposalId())&&e.writeInt64(2,r),(r=t.getIsAddApproval())&&e.writeBool(3,r)},proto.protocol.ProposalApproveContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ProposalApproveContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ProposalApproveContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ProposalApproveContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ProposalApproveContract.prototype.getProposalId=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.ProposalApproveContract.prototype.setProposalId=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.ProposalApproveContract.prototype.getIsAddApproval=function(){return o.Message.getBooleanFieldWithDefault(this,3,!1)},proto.protocol.ProposalApproveContract.prototype.setIsAddApproval=function(t){return o.Message.setProto3BooleanField(this,3,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ProposalCreateContract.prototype.toObject=function(t){return proto.protocol.ProposalCreateContract.toObject(t,this)},proto.protocol.ProposalCreateContract.toObject=function(t,e){var r,o={ownerAddress:e.getOwnerAddress_asB64(),parametersMap:(r=e.getParametersMap())?r.toObject(t,void 0):[]};return t&&(o.$jspbMessageInstance=e),o}),proto.protocol.ProposalCreateContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ProposalCreateContract;return proto.protocol.ProposalCreateContract.deserializeBinaryFromReader(r,e)},proto.protocol.ProposalCreateContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=t.getParametersMap();e.readMessage(r,(function(t,e){o.Map.deserializeBinary(t,e,o.BinaryReader.prototype.readInt64,o.BinaryReader.prototype.readInt64,null,0,0)}));break;default:e.skipField()}}return t},proto.protocol.ProposalCreateContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ProposalCreateContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ProposalCreateContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getParametersMap(!0))&&r.getLength()>0&&r.serializeBinary(2,e,o.BinaryWriter.prototype.writeInt64,o.BinaryWriter.prototype.writeInt64)},proto.protocol.ProposalCreateContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ProposalCreateContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ProposalCreateContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ProposalCreateContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ProposalCreateContract.prototype.getParametersMap=function(t){return o.Message.getMapField(this,2,t,null)},proto.protocol.ProposalCreateContract.prototype.clearParametersMap=function(){return this.getParametersMap().clear(),this},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ProposalDeleteContract.prototype.toObject=function(t){return proto.protocol.ProposalDeleteContract.toObject(t,this)},proto.protocol.ProposalDeleteContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),proposalId:o.Message.getFieldWithDefault(e,2,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.ProposalDeleteContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ProposalDeleteContract;return proto.protocol.ProposalDeleteContract.deserializeBinaryFromReader(r,e)},proto.protocol.ProposalDeleteContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setProposalId(r);break;default:e.skipField()}}return t},proto.protocol.ProposalDeleteContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ProposalDeleteContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ProposalDeleteContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getProposalId())&&e.writeInt64(2,r)},proto.protocol.ProposalDeleteContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ProposalDeleteContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ProposalDeleteContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ProposalDeleteContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ProposalDeleteContract.prototype.getProposalId=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.ProposalDeleteContract.prototype.setProposalId=function(t){return o.Message.setProto3IntField(this,2,t)},n.object.extend(e,proto.protocol)},function(t,e,r){var o=r(8),n=o,s=function(){return this||window||s||self||Function("return this")()}.call(null);n.exportSymbol("proto.protocol.ExchangeCreateContract",null,s),n.exportSymbol("proto.protocol.ExchangeInjectContract",null,s),n.exportSymbol("proto.protocol.ExchangeTransactionContract",null,s),n.exportSymbol("proto.protocol.ExchangeWithdrawContract",null,s),proto.protocol.ExchangeCreateContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ExchangeCreateContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ExchangeCreateContract.displayName="proto.protocol.ExchangeCreateContract"),proto.protocol.ExchangeInjectContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ExchangeInjectContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ExchangeInjectContract.displayName="proto.protocol.ExchangeInjectContract"),proto.protocol.ExchangeWithdrawContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ExchangeWithdrawContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ExchangeWithdrawContract.displayName="proto.protocol.ExchangeWithdrawContract"),proto.protocol.ExchangeTransactionContract=function(t){o.Message.initialize(this,t,0,-1,null,null)},n.inherits(proto.protocol.ExchangeTransactionContract,o.Message),n.DEBUG&&!COMPILED&&(proto.protocol.ExchangeTransactionContract.displayName="proto.protocol.ExchangeTransactionContract"),o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ExchangeCreateContract.prototype.toObject=function(t){return proto.protocol.ExchangeCreateContract.toObject(t,this)},proto.protocol.ExchangeCreateContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),firstTokenId:e.getFirstTokenId_asB64(),firstTokenBalance:o.Message.getFieldWithDefault(e,3,0),secondTokenId:e.getSecondTokenId_asB64(),secondTokenBalance:o.Message.getFieldWithDefault(e,5,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.ExchangeCreateContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ExchangeCreateContract;return proto.protocol.ExchangeCreateContract.deserializeBinaryFromReader(r,e)},proto.protocol.ExchangeCreateContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readBytes();t.setFirstTokenId(r);break;case 3:r=e.readInt64();t.setFirstTokenBalance(r);break;case 4:r=e.readBytes();t.setSecondTokenId(r);break;case 5:r=e.readInt64();t.setSecondTokenBalance(r);break;default:e.skipField()}}return t},proto.protocol.ExchangeCreateContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ExchangeCreateContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ExchangeCreateContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),(r=t.getFirstTokenId_asU8()).length>0&&e.writeBytes(2,r),0!==(r=t.getFirstTokenBalance())&&e.writeInt64(3,r),(r=t.getSecondTokenId_asU8()).length>0&&e.writeBytes(4,r),0!==(r=t.getSecondTokenBalance())&&e.writeInt64(5,r)},proto.protocol.ExchangeCreateContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ExchangeCreateContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ExchangeCreateContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ExchangeCreateContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ExchangeCreateContract.prototype.getFirstTokenId=function(){return o.Message.getFieldWithDefault(this,2,"")},proto.protocol.ExchangeCreateContract.prototype.getFirstTokenId_asB64=function(){return o.Message.bytesAsB64(this.getFirstTokenId())},proto.protocol.ExchangeCreateContract.prototype.getFirstTokenId_asU8=function(){return o.Message.bytesAsU8(this.getFirstTokenId())},proto.protocol.ExchangeCreateContract.prototype.setFirstTokenId=function(t){return o.Message.setProto3BytesField(this,2,t)},proto.protocol.ExchangeCreateContract.prototype.getFirstTokenBalance=function(){return o.Message.getFieldWithDefault(this,3,0)},proto.protocol.ExchangeCreateContract.prototype.setFirstTokenBalance=function(t){return o.Message.setProto3IntField(this,3,t)},proto.protocol.ExchangeCreateContract.prototype.getSecondTokenId=function(){return o.Message.getFieldWithDefault(this,4,"")},proto.protocol.ExchangeCreateContract.prototype.getSecondTokenId_asB64=function(){return o.Message.bytesAsB64(this.getSecondTokenId())},proto.protocol.ExchangeCreateContract.prototype.getSecondTokenId_asU8=function(){return o.Message.bytesAsU8(this.getSecondTokenId())},proto.protocol.ExchangeCreateContract.prototype.setSecondTokenId=function(t){return o.Message.setProto3BytesField(this,4,t)},proto.protocol.ExchangeCreateContract.prototype.getSecondTokenBalance=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.ExchangeCreateContract.prototype.setSecondTokenBalance=function(t){return o.Message.setProto3IntField(this,5,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ExchangeInjectContract.prototype.toObject=function(t){return proto.protocol.ExchangeInjectContract.toObject(t,this)},proto.protocol.ExchangeInjectContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),exchangeId:o.Message.getFieldWithDefault(e,2,0),tokenId:e.getTokenId_asB64(),quant:o.Message.getFieldWithDefault(e,4,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.ExchangeInjectContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ExchangeInjectContract;return proto.protocol.ExchangeInjectContract.deserializeBinaryFromReader(r,e)},proto.protocol.ExchangeInjectContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setExchangeId(r);break;case 3:r=e.readBytes();t.setTokenId(r);break;case 4:r=e.readInt64();t.setQuant(r);break;default:e.skipField()}}return t},proto.protocol.ExchangeInjectContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ExchangeInjectContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ExchangeInjectContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getExchangeId())&&e.writeInt64(2,r),(r=t.getTokenId_asU8()).length>0&&e.writeBytes(3,r),0!==(r=t.getQuant())&&e.writeInt64(4,r)},proto.protocol.ExchangeInjectContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ExchangeInjectContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ExchangeInjectContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ExchangeInjectContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ExchangeInjectContract.prototype.getExchangeId=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.ExchangeInjectContract.prototype.setExchangeId=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.ExchangeInjectContract.prototype.getTokenId=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.ExchangeInjectContract.prototype.getTokenId_asB64=function(){return o.Message.bytesAsB64(this.getTokenId())},proto.protocol.ExchangeInjectContract.prototype.getTokenId_asU8=function(){return o.Message.bytesAsU8(this.getTokenId())},proto.protocol.ExchangeInjectContract.prototype.setTokenId=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.ExchangeInjectContract.prototype.getQuant=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.ExchangeInjectContract.prototype.setQuant=function(t){return o.Message.setProto3IntField(this,4,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ExchangeWithdrawContract.prototype.toObject=function(t){return proto.protocol.ExchangeWithdrawContract.toObject(t,this)},proto.protocol.ExchangeWithdrawContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),exchangeId:o.Message.getFieldWithDefault(e,2,0),tokenId:e.getTokenId_asB64(),quant:o.Message.getFieldWithDefault(e,4,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.ExchangeWithdrawContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ExchangeWithdrawContract;return proto.protocol.ExchangeWithdrawContract.deserializeBinaryFromReader(r,e)},proto.protocol.ExchangeWithdrawContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setExchangeId(r);break;case 3:r=e.readBytes();t.setTokenId(r);break;case 4:r=e.readInt64();t.setQuant(r);break;default:e.skipField()}}return t},proto.protocol.ExchangeWithdrawContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ExchangeWithdrawContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ExchangeWithdrawContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getExchangeId())&&e.writeInt64(2,r),(r=t.getTokenId_asU8()).length>0&&e.writeBytes(3,r),0!==(r=t.getQuant())&&e.writeInt64(4,r)},proto.protocol.ExchangeWithdrawContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ExchangeWithdrawContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ExchangeWithdrawContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ExchangeWithdrawContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ExchangeWithdrawContract.prototype.getExchangeId=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.ExchangeWithdrawContract.prototype.setExchangeId=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.ExchangeWithdrawContract.prototype.getTokenId=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.ExchangeWithdrawContract.prototype.getTokenId_asB64=function(){return o.Message.bytesAsB64(this.getTokenId())},proto.protocol.ExchangeWithdrawContract.prototype.getTokenId_asU8=function(){return o.Message.bytesAsU8(this.getTokenId())},proto.protocol.ExchangeWithdrawContract.prototype.setTokenId=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.ExchangeWithdrawContract.prototype.getQuant=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.ExchangeWithdrawContract.prototype.setQuant=function(t){return o.Message.setProto3IntField(this,4,t)},o.Message.GENERATE_TO_OBJECT&&(proto.protocol.ExchangeTransactionContract.prototype.toObject=function(t){return proto.protocol.ExchangeTransactionContract.toObject(t,this)},proto.protocol.ExchangeTransactionContract.toObject=function(t,e){var r={ownerAddress:e.getOwnerAddress_asB64(),exchangeId:o.Message.getFieldWithDefault(e,2,0),tokenId:e.getTokenId_asB64(),quant:o.Message.getFieldWithDefault(e,4,0),expected:o.Message.getFieldWithDefault(e,5,0)};return t&&(r.$jspbMessageInstance=e),r}),proto.protocol.ExchangeTransactionContract.deserializeBinary=function(t){var e=new o.BinaryReader(t),r=new proto.protocol.ExchangeTransactionContract;return proto.protocol.ExchangeTransactionContract.deserializeBinaryFromReader(r,e)},proto.protocol.ExchangeTransactionContract.deserializeBinaryFromReader=function(t,e){for(;e.nextField()&&!e.isEndGroup();){switch(e.getFieldNumber()){case 1:var r=e.readBytes();t.setOwnerAddress(r);break;case 2:r=e.readInt64();t.setExchangeId(r);break;case 3:r=e.readBytes();t.setTokenId(r);break;case 4:r=e.readInt64();t.setQuant(r);break;case 5:r=e.readInt64();t.setExpected(r);break;default:e.skipField()}}return t},proto.protocol.ExchangeTransactionContract.prototype.serializeBinary=function(){var t=new o.BinaryWriter;return proto.protocol.ExchangeTransactionContract.serializeBinaryToWriter(this,t),t.getResultBuffer()},proto.protocol.ExchangeTransactionContract.serializeBinaryToWriter=function(t,e){var r=void 0;(r=t.getOwnerAddress_asU8()).length>0&&e.writeBytes(1,r),0!==(r=t.getExchangeId())&&e.writeInt64(2,r),(r=t.getTokenId_asU8()).length>0&&e.writeBytes(3,r),0!==(r=t.getQuant())&&e.writeInt64(4,r),0!==(r=t.getExpected())&&e.writeInt64(5,r)},proto.protocol.ExchangeTransactionContract.prototype.getOwnerAddress=function(){return o.Message.getFieldWithDefault(this,1,"")},proto.protocol.ExchangeTransactionContract.prototype.getOwnerAddress_asB64=function(){return o.Message.bytesAsB64(this.getOwnerAddress())},proto.protocol.ExchangeTransactionContract.prototype.getOwnerAddress_asU8=function(){return o.Message.bytesAsU8(this.getOwnerAddress())},proto.protocol.ExchangeTransactionContract.prototype.setOwnerAddress=function(t){return o.Message.setProto3BytesField(this,1,t)},proto.protocol.ExchangeTransactionContract.prototype.getExchangeId=function(){return o.Message.getFieldWithDefault(this,2,0)},proto.protocol.ExchangeTransactionContract.prototype.setExchangeId=function(t){return o.Message.setProto3IntField(this,2,t)},proto.protocol.ExchangeTransactionContract.prototype.getTokenId=function(){return o.Message.getFieldWithDefault(this,3,"")},proto.protocol.ExchangeTransactionContract.prototype.getTokenId_asB64=function(){return o.Message.bytesAsB64(this.getTokenId())},proto.protocol.ExchangeTransactionContract.prototype.getTokenId_asU8=function(){return o.Message.bytesAsU8(this.getTokenId())},proto.protocol.ExchangeTransactionContract.prototype.setTokenId=function(t){return o.Message.setProto3BytesField(this,3,t)},proto.protocol.ExchangeTransactionContract.prototype.getQuant=function(){return o.Message.getFieldWithDefault(this,4,0)},proto.protocol.ExchangeTransactionContract.prototype.setQuant=function(t){return o.Message.setProto3IntField(this,4,t)},proto.protocol.ExchangeTransactionContract.prototype.getExpected=function(){return o.Message.getFieldWithDefault(this,5,0)},proto.protocol.ExchangeTransactionContract.prototype.setExpected=function(t){return o.Message.setProto3IntField(this,5,t)},n.object.extend(e,proto.protocol)},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return To}));var o={};r.r(o),r.d(o,"byte2hexStr",(function(){return _})),r.d(o,"bytesToString",(function(){return S})),r.d(o,"hextoString",(function(){return D})),r.d(o,"byteArray2hexStr",(function(){return z})),r.d(o,"base64DecodeFromString",(function(){return U})),r.d(o,"base64EncodeToString",(function(){return N}));var n={};r.r(n),r.d(n,"bin2String",(function(){return G})),r.d(n,"arrayEquals",(function(){return q})),r.d(n,"stringToBytes",(function(){return H})),r.d(n,"byte2hexStr",(function(){return _})),r.d(n,"bytesToString",(function(){return S})),r.d(n,"hextoString",(function(){return D})),r.d(n,"byteArray2hexStr",(function(){return z})),r.d(n,"base64DecodeFromString",(function(){return U})),r.d(n,"base64EncodeToString",(function(){return N})),r.d(n,"hexChar2byte",(function(){return K})),r.d(n,"isHexChar",(function(){return J})),r.d(n,"hexStr2byteArray",(function(){return $})),r.d(n,"strToDate",(function(){return Y})),r.d(n,"isNumber",(function(){return Q})),r.d(n,"getStringType",(function(){return Z}));var s={};r.r(s),r.d(s,"encode58",(function(){return rt})),r.d(s,"decode58",(function(){return ot}));var a={};r.r(a),r.d(a,"keccak256",(function(){return at})),r.d(a,"sha256",(function(){return it})),r.d(a,"toUtf8Bytes",(function(){return ct})),r.d(a,"toUtf8String",(function(){return pt})),r.d(a,"recoverAddress",(function(){return lt})),r.d(a,"SigningKey",(function(){return ut})),r.d(a,"AbiCoder",(function(){return dt})),r.d(a,"Interface",(function(){return gt})),r.d(a,"FormatTypes",(function(){return ht})),r.d(a,"splitSignature",(function(){return yt})),r.d(a,"joinSignature",(function(){return vt})),r.d(a,"arrayify",(function(){return ft})),r.d(a,"ethersWallet",(function(){return st.Wallet})),r.d(a,"concat",(function(){return mt})),r.d(a,"id",(function(){return At})),r.d(a,"isValidMnemonic",(function(){return Bt}));var i={};r.r(i),r.d(i,"getBase58CheckAddress",(function(){return Vt})),r.d(i,"decodeBase58Address",(function(){return Gt})),r.d(i,"signTransaction",(function(){return qt})),r.d(i,"arrayToBase64String",(function(){return Ht})),r.d(i,"signBytes",(function(){return Kt})),r.d(i,"_signTypedData",(function(){return Jt})),r.d(i,"getRowBytesFromTransactionBase64",(function(){return $t})),r.d(i,"genPriKey",(function(){return Yt})),r.d(i,"computeAddress",(function(){return Qt})),r.d(i,"getAddressFromPriKey",(function(){return Zt})),r.d(i,"decode58Check",(function(){return Xt})),r.d(i,"isAddressValid",(function(){return te})),r.d(i,"getBase58CheckAddressFromPriKeyBase64String",(function(){return ee})),r.d(i,"getHexStrAddressFromPriKeyBase64String",(function(){return re})),r.d(i,"getAddressFromPriKeyBase64String",(function(){return oe})),r.d(i,"getPubKeyFromPriKey",(function(){return ne})),r.d(i,"ECKeySign",(function(){return se})),r.d(i,"SHA256",(function(){return ae})),r.d(i,"passwordToAddress",(function(){return ie})),r.d(i,"pkToAddress",(function(){return ce}));var c={};r.r(c),r.d(c,"generateAccount",(function(){return pe})),r.d(c,"generateRandom",(function(){return le})),r.d(c,"generateAccountWithMnemonic",(function(){return ue}));var p={};r.r(p),r.d(p,"decodeParams",(function(){return fe})),r.d(p,"encodeParams",(function(){return ye})),r.d(p,"encodeParamsV2ByABI",(function(){return Ae})),r.d(p,"decodeParamsV2ByABI",(function(){return Be}));var l={};r.r(l),r.d(l,"TRON_MESSAGE_PREFIX",(function(){return be})),r.d(l,"hashMessage",(function(){return Ce})),r.d(l,"signMessage",(function(){return we})),r.d(l,"verifyMessage",(function(){return Te}));var u={};r.r(u),r.d(u,"txJsonToPb",(function(){return Tr})),r.d(u,"txPbToTxID",(function(){return Wr})),r.d(u,"txJsonToPbWithArgs",(function(){return Fr})),r.d(u,"txCheckWithArgs",(function(){return kr})),r.d(u,"txCheck",(function(){return Mr}));var d=r(1),g=r.n(d),h=r(9),f=r.n(h),y=r(2),v=r.n(y),m=r(3),A=r.n(m),B=r(15),b=r.n(B),C=r(22),w=r.n(C),T=r(23),F=r.n(T),I=r(19),M=r.n(I),k=r(4),W=r.n(k),O=r(0),E=r.n(O),P=r(24),x=r.n(P);function R(){var t=this;this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",this.encode=function(e){for(var r,o,n,s,a,i,c,p="",l=0;l<e.length;)s=(r=e.charCodeAt(l++))>>2,a=(3&r)<<4|(o=e.charCodeAt(l++))>>4,i=(15&o)<<2|(n=e.charCodeAt(l++))>>6,c=63&n,isNaN(o)?i=c=64:isNaN(n)&&(c=64),p=p+t._keyStr.charAt(s)+t._keyStr.charAt(a)+t._keyStr.charAt(i)+t._keyStr.charAt(c);return p},this.encodeIgnoreUtf8=function(e){for(var r,o,n,s,a,i,c,p="",l=0;l<e.length;)s=(r=e[l++])>>2,a=(3&r)<<4|(o=e[l++])>>4,i=(15&o)<<2|(n=e[l++])>>6,c=63&n,isNaN(o)?i=c=64:isNaN(n)&&(c=64),p=p+t._keyStr.charAt(s)+t._keyStr.charAt(a)+t._keyStr.charAt(i)+t._keyStr.charAt(c);return p},this.decode=function(e){var r,o,n,s,a,i,c="",p=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");p<e.length;)r=t._keyStr.indexOf(e.charAt(p++))<<2|(s=t._keyStr.indexOf(e.charAt(p++)))>>4,o=(15&s)<<4|(a=t._keyStr.indexOf(e.charAt(p++)))>>2,n=(3&a)<<6|(i=t._keyStr.indexOf(e.charAt(p++))),c+=String.fromCharCode(r),64!=a&&(c+=String.fromCharCode(o)),64!=i&&(c+=String.fromCharCode(n));return t._utf8_decode(c)},this.decodeToByteArray=function(e){var r,o,n,s,a,i,c="",p=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");p<e.length;)r=t._keyStr.indexOf(e.charAt(p++))<<2|(s=t._keyStr.indexOf(e.charAt(p++)))>>4,o=(15&s)<<4|(a=t._keyStr.indexOf(e.charAt(p++)))>>2,n=(3&a)<<6|(i=t._keyStr.indexOf(e.charAt(p++))),c+=String.fromCharCode(r),64!=a&&(c+=String.fromCharCode(o)),64!=i&&(c+=String.fromCharCode(n));return t._out2ByteArray(c)},this._out2ByteArray=function(t){for(var e=new Array(t.length),r=0,o=0;r<t.length;)o=t.charCodeAt(r),e[r]=o,r++;return e},this._utf8_encode=function(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;r<t.length;r++){var o=t.charCodeAt(r);o<128?e+=String.fromCharCode(o):o>127&&o<2048?(e+=String.fromCharCode(o>>6|192),e+=String.fromCharCode(63&o|128)):(e+=String.fromCharCode(o>>12|224),e+=String.fromCharCode(o>>6&63|128),e+=String.fromCharCode(63&o|128))}return e},this._utf8_decode=function(t){for(var e="",r=0,o=0,n=0,s=0;r<t.length;)(o=t.charCodeAt(r))<128?(e+=String.fromCharCode(o),r++):o>191&&o<224?(n=t.charCodeAt(r+1),e+=String.fromCharCode((31&o)<<6|63&n),r+=2):(n=t.charCodeAt(r+1),s=t.charCodeAt(r+2),e+=String.fromCharCode((15&o)<<12|(63&n)<<6|63&s),r+=3);return e}}function _(t){if("number"!=typeof t)throw new Error("Input must be a number");if(t<0||t>255)throw new Error("Input must be a byte");var e="";return e+="0123456789ABCDEF".charAt(t>>4),e+="0123456789ABCDEF".charAt(15&t)}function S(t){if("string"==typeof t)return t;for(var e="",r=0;r<t.length;r++){var o=t[r].toString(2),n=o.match(/^1+?(?=0)/);if(n&&8===o.length){for(var s=n[0].length,a=t[r].toString(2).slice(7-s),i=1;i<s;i++)a+=t[i+r].toString(2).slice(2);e+=String.fromCharCode(parseInt(a,2)),r+=s-1}else e+=String.fromCharCode(t[r])}return e}function D(t){for(var e=t.replace(/^0x/,"").split(""),r="",o=0;o<e.length/2;o++){var n="0x".concat(e[2*o]).concat(e[2*o+1]);r+=String.fromCharCode(n)}return r}function z(t){for(var e="",r=0;r<t.length;r++)e+=_(t[r]);return e}function U(t){return(new R).decodeToByteArray(t)}function N(t){return(new R).encodeIgnoreUtf8(t)}var j=r(10),L=r.n(j),V=/^(41)/;function G(t){return S(t)}function q(t,e,r){if(t.length!=e.length)return!1;var o;for(o=0;o<t.length;o++)if(r){if(t[o]!=e[o])return!1}else if(JSON.stringify(t[o])!=JSON.stringify(e[o]))return!1;return!0}function H(t){if("string"!=typeof t)throw new Error("The passed string is not a string");var e,r,o=new Array;e=t.length;for(var n=0;n<e;n++)(r=t.charCodeAt(n))>=65536&&r<=1114111?(o.push(r>>18&7|240),o.push(r>>12&63|128),o.push(r>>6&63|128),o.push(63&r|128)):r>=2048&&r<=65535?(o.push(r>>12&15|224),o.push(r>>6&63|128),o.push(63&r|128)):r>=128&&r<=2047?(o.push(r>>6&31|192),o.push(63&r|128)):o.push(255&r);return o}function K(t){var e;if(t>="A"&&t<="F"?e=t.charCodeAt(0)-"A".charCodeAt(0)+10:t>="a"&&t<="f"?e=t.charCodeAt(0)-"a".charCodeAt(0)+10:t>="0"&&t<="9"&&(e=t.charCodeAt(0)-"0".charCodeAt(0)),"number"==typeof e)return e;throw new Error("The passed hex char is not a valid hex char")}function J(t){return t>="A"&&t<="F"||t>="a"&&t<="f"||t>="0"&&t<="9"?1:0}function $(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof t)throw new Error("The passed string is not a string");var r=t.length;e&&r%2&&(t="0".concat(t),r++);for(var o=Array(),n=0,s=0,a=0,i=0;i<r;i++){var c=t.charAt(i);if(!J(c))throw new Error("The passed hex char is not a valid hex string");n<<=4,n+=K(c),0==++s%2&&(o[a++]=n,n=0)}return o}function Y(t){if(!/^\d{4}-\d{2}-\d{2}( \d{2}-\d{2}-\d{2}|)/.test(t))throw new Error("The passed date string is not valid");var e=t.split(" "),r=e[0].split("-"),o=parseInt(r[0],10),n=parseInt(r[1],10)-1,s=parseInt(r[2],10);if(e.length>1){var a=e[1].split("-"),i=parseInt(a[0],10),c=parseInt(a[1],10),p=parseInt(a[2],10);return new Date(o,n,s,i,c,p)}return new Date(o,n,s)}function Q(t){return t>="0"&&t<="9"?1:0}function Z(t){if(null==t)return-1;if("string"!=typeof t)return-1;if(0==t.length||""==t)return-1;var e=0;if(40==t.length)for(;e<40;e++){if(!J(t.charAt(e)))break}if(40==e)return 1;for(e=0;e<t.length;e++){if(!Q(t.charAt(e)))break}if(e==t.length)return 2;for(e=0;e<t.length;e++){if(t.charAt(e)>" ")return 3}return-1}for(var X="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",tt={},et=0;et<X.length;et++)tt[X.charAt(et)]=et;function rt(t){if(0===t.length)return"";var e,r,o=[0];for(e=0;e<t.length;e++){for(r=0;r<o.length;r++)o[r]<<=8;o[0]+=t[e];var n=0;for(r=0;r<o.length;++r)o[r]+=n,n=o[r]/58|0,o[r]%=58;for(;n;)o.push(n%58),n=n/58|0}for(e=0;0===t[e]&&e<t.length-1;e++)o.push(0);return o.reverse().map((function(t){return X[t]})).join("")}function ot(t){if(0===t.length)return[];var e,r,o=[0];for(e=0;e<t.length;e++){var n=t[e];if(!(n in tt))throw new Error("Non-base58 character");for(r=0;r<o.length;r++)o[r]*=58;o[0]+=tt[n];var s=0;for(r=0;r<o.length;++r)o[r]+=s,s=o[r]>>8,o[r]&=255;for(;s;)o.push(255&s),s>>=8}for(e=0;"1"===t[e]&&e<t.length-1;e++)o.push(0);return o.reverse()}var nt=r(18),st=r(5),at=st.utils.keccak256,it=st.utils.sha256,ct=st.utils.toUtf8Bytes,pt=st.utils.toUtf8String,lt=st.utils.recoverAddress,ut=st.utils.SigningKey,dt=st.utils.AbiCoder,gt=st.utils.Interface,ht=st.utils.FormatTypes,ft=st.utils.arrayify,yt=st.utils.splitSignature,vt=st.utils.joinSignature,mt=st.utils.concat,At=st.utils.id,Bt=st.utils.isValidMnemonic,bt=r(11),Ct=r(6),wt=r(13),Tt=r(16),Ft=r(25),It=new(r(26).Logger)("tronweb/hash/5.4.0");function Mt(t){return To.address.toHex(t)}function kt(t){return Object(wt.keccak256)(Object(Ft.toUtf8Bytes)(t))}var Wt=new Uint8Array(32);Wt.fill(0);var Ot=bt.BigNumber.from(-1),Et=bt.BigNumber.from(0),Pt=bt.BigNumber.from(1),xt=bt.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Rt=Object(Ct.hexZeroPad)(Pt.toHexString(),32),_t=Object(Ct.hexZeroPad)(Et.toHexString(),32),St={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Dt=["name","version","chainId","verifyingContract","salt"];function zt(t){return function(e){return"string"!=typeof e&&It.throwArgumentError("invalid domain value for ".concat(JSON.stringify(t)),"domain.".concat(t),e),e}}var Ut={name:zt("name"),version:zt("version"),chainId:function(t){try{return bt.BigNumber.from(t).toString()}catch(t){}return It.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Mt(t).toLowerCase()}catch(t){}return It.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{var e=Object(Ct.arrayify)(t);if(32!==e.length)throw new Error("bad length");return Object(Ct.hexlify)(e)}catch(t){}return It.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Nt(t){var e=t.match(/^(u?)int(\d*)$/);if(e){var r=""===e[1],o=parseInt(e[2]||"256");(o%8!=0||o>256||e[2]&&e[2]!==String(o))&&It.throwArgumentError("invalid numeric width","type",t);var n=xt.mask(r?o-1:o),s=r?n.add(Pt).mul(Ot):Et;return function(e){var r=bt.BigNumber.from(e);return(r.lt(s)||r.gt(n))&&It.throwArgumentError("value out-of-bounds for ".concat(t),"value",e),Object(Ct.hexZeroPad)(r.toTwos(256).toHexString(),32)}}var a=t.match(/^bytes(\d+)$/);if(a){var i=parseInt(a[1]);return(0===i||i>32||a[1]!==String(i))&&It.throwArgumentError("invalid bytes width","type",t),function(e){return Object(Ct.arrayify)(e).length!==i&&It.throwArgumentError("invalid length for ".concat(t),"value",e),function(t){var e=Object(Ct.arrayify)(t),r=e.length%32;return r?Object(Ct.hexConcat)([e,Wt.slice(r)]):Object(Ct.hexlify)(e)}(e)}}switch(t){case"trcToken":return Nt("uint256");case"address":return function(t){return Object(Ct.hexZeroPad)((e=t,To.address.toHex(e).replace(V,"0x")),32);var e};case"bool":return function(t){return t?Rt:_t};case"bytes":return function(t){return Object(wt.keccak256)(t)};case"string":return function(t){return kt(t)}}return null}function jt(t,e){return"".concat(t,"(").concat(e.map((function(t){var e=t.name;return t.type+" "+e})).join(","),")")}var Lt=function(){function t(e){v()(this,t),Object(Tt.defineReadOnly)(this,"types",Object.freeze(Object(Tt.deepCopy)(e))),Object(Tt.defineReadOnly)(this,"_encoderCache",{}),Object(Tt.defineReadOnly)(this,"_types",{});var r={},o={},n={};Object.keys(e).forEach((function(t){r[t]={},o[t]=[],n[t]={}}));var s=function(t){var n={};e[t].forEach((function(s){n[s.name]&&It.throwArgumentError("duplicate variable name ".concat(JSON.stringify(s.name)," in ").concat(JSON.stringify(t)),"types",e),n[s.name]=!0;var a=s.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===t&&It.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",e),Nt(a)||(o[a]||It.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",e),o[a].push(t),r[t][a]=!0)}))};for(var a in e)s(a);var i=Object.keys(o).filter((function(t){return 0===o[t].length}));for(var c in 0===i.length?It.throwArgumentError("missing primary type","types",e):i.length>1&&It.throwArgumentError("ambiguous primary types or unused types: ".concat(i.map((function(t){return JSON.stringify(t)})).join(", ")),"types",e),Object(Tt.defineReadOnly)(this,"primaryType",i[0]),function t(s,a){a[s]&&It.throwArgumentError("circular type reference to ".concat(JSON.stringify(s)),"types",e),a[s]=!0,Object.keys(r[s]).forEach((function(e){o[e]&&(t(e,a),Object.keys(a).forEach((function(t){n[t][e]=!0})))})),delete a[s]}(this.primaryType,{}),n){var p=Object.keys(n[c]);p.sort(),this._types[c]=jt(c,e[c])+p.map((function(t){return jt(t,e[t])})).join("")}}return A()(t,[{key:"getEncoder",value:function(t){var e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}},{key:"_getEncoder",value:function(t){var e=this,r=Nt(t);if(r)return r;var o=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(o){var n=o[1],s=this.getEncoder(n),a=parseInt(o[3]);return function(t){a>=0&&t.length!==a&&It.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);var r=t.map(s);return e._types[n]&&(r=r.map(wt.keccak256)),Object(wt.keccak256)(Object(Ct.hexConcat)(r))}}var i=this.types[t];if(i){var c=kt(this._types[t]);return function(t){var r=i.map((function(r){var o=r.name,n=r.type,s=e.getEncoder(n)(t[o]);return e._types[n]?Object(wt.keccak256)(s):s}));return r.unshift(c),Object(Ct.hexConcat)(r)}}return It.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"encodeType",value:function(t){var e=this._types[t];return e||It.throwArgumentError("unknown type: ".concat(JSON.stringify(t)),"name",t),e}},{key:"encodeData",value:function(t,e){return this.getEncoder(t)(e)}},{key:"hashStruct",value:function(t,e){return Object(wt.keccak256)(this.encodeData(t,e))}},{key:"encode",value:function(t){return this.encodeData(this.primaryType,t)}},{key:"hash",value:function(t){return this.hashStruct(this.primaryType,t)}},{key:"_visit",value:function(t,e,r){var o=this;if(Nt(t))return r(t,e);var n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var s=n[1],a=parseInt(n[3]);return a>=0&&e.length!==a&&It.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((function(t){return o._visit(s,t,r)}))}var i=this.types[t];return i?i.reduce((function(t,n){var s=n.name,a=n.type;return t[s]=o._visit(a,e[s],r),t}),{}):It.throwArgumentError("unknown type: ".concat(t),"type",t)}},{key:"visit",value:function(t,e){return this._visit(this.primaryType,t,e)}}],[{key:"from",value:function(e){return new t(e)}},{key:"getPrimaryType",value:function(e){return t.from(e).primaryType}},{key:"hashStruct",value:function(e,r,o){return t.from(r).hashStruct(e,o)}},{key:"hashDomain",value:function(e){var r=[];for(var o in e){var n=St[o];n||It.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(o)),"domain",e),r.push({name:o,type:n})}return r.sort((function(t,e){return Dt.indexOf(t.name)-Dt.indexOf(e.name)})),t.hashStruct("EIP712Domain",{EIP712Domain:r},e)}},{key:"encode",value:function(e,r,o){return Object(Ct.hexConcat)(["0x1901",t.hashDomain(e),t.from(r).hash(o)])}},{key:"hash",value:function(e,r,o){return Object(wt.keccak256)(t.encode(e,r,o))}},{key:"getPayload",value:function(e,r,o){t.hashDomain(e);var n={},s=[];Dt.forEach((function(t){var r=e[t];null!=r&&(n[t]=Ut[t](r),s.push({name:t,type:St[t]}))}));var a=t.from(r),i=Object(Tt.shallowCopy)(r);return i.EIP712Domain?It.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):i.EIP712Domain=s,a.encode(o),{types:i,domain:n,primaryType:a.primaryType,message:a.visit(o,(function(t,e){if(t.match(/^bytes(\d*)/))return Object(Ct.hexlify)(Object(Ct.arrayify)(e));if(t.match(/^u?int/))return bt.BigNumber.from(e).toString();switch(t){case"trcToken":return bt.BigNumber.from(e).toString();case"address":return Mt(e).toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&It.throwArgumentError("invalid string","value",e),e}return It.throwArgumentError("unsupported type","type",t)}))}}}]),t}();function Vt(t){var e=ae(t),r=ae(e).slice(0,4);return rt(r=t.concat(r))}function Gt(t){if("string"!=typeof t)return!1;if(t.length<=4)return!1;var e=ot(t);if(t.length<=4)return!1;var r=e.length-4,o=e.slice(r),n=ae(e=e.slice(0,r)),s=ae(n).slice(0,4);if(o[0]==s[0]&&o[1]==s[1]&&o[2]==s[2]&&o[3]==s[3])return e;throw new Error("Invalid address provided")}function qt(t,e){"string"==typeof t&&(t=$(t));var r=se($(e.txID),t);return Array.isArray(e.signature)?e.signature.includes(r)||e.signature.push(r):e.signature=[r],e}function Ht(t){return btoa(String.fromCharCode.apply(String,L()(t)))}function Kt(t,e){return"string"==typeof t&&(t=$(t)),se(ae(e),t)}function Jt(t,e,r,o){var n=new ut({toHexString:function(){return"0x"+o},value:o}),s=Lt.hash(t,e,r),a=n.signDigest(s);return["0x",a.r.substring(2),a.s.substring(2),Number(a.v).toString(16)].join("")}function $t(t){var e=U(t);return proto.protocol.Transaction.deserializeBinary(e).getRawData().serializeBinary()}function Yt(){for(var t=new nt.ec("secp256k1").genKeyPair().getPrivate().toString("hex");t.length<64;)t="0".concat(t);return $(t)}function Qt(t){return 65===t.length&&(t=t.slice(1)),$("41"+at(t).toString().substring(2).substring(24))}function Zt(t){return Qt(ne(t))}function Xt(t){var e=ot(t);if(e.length<=4)return!1;var r=e.slice(0,e.length-4),o=ae(r),n=ae(o);return n[0]===e[r.length]&&n[1]===e[r.length+1]&&n[2]===e[r.length+2]&&n[3]===e[r.length+3]&&r}function te(t){if("string"!=typeof t)return!1;if(34!==t.length)return!1;var e=ot(t);if(25!==e.length)return!1;if(65!==e[0])return!1;var r=e.slice(21),o=ae(e=e.slice(0,21)),n=ae(o).slice(0,4);return r[0]==n[0]&&r[1]==n[1]&&r[2]==n[2]&&r[3]==n[3]}function ee(t){return Vt(Qt(ne(U(t))))}function re(t){return z(Qt(ne(U(t))))}function oe(t){return N(Qt(ne(U(t))))}function ne(t){for(var e=new nt.ec("secp256k1").keyFromPrivate(t,"bytes").getPublic(),r=e.x,o=e.y,n=r.toString("hex");n.length<64;)n="0".concat(n);for(var s=o.toString("hex");s.length<64;)s="0".concat(s);return $("04".concat(n).concat(s))}function se(t,e){for(var r=new nt.ec("secp256k1").keyFromPrivate(e,"bytes").sign(t),o=r.r,n=r.s,s=r.recoveryParam,a=o.toString("hex");a.length<64;)a="0".concat(a);for(var i=n.toString("hex");i.length<64;)i="0".concat(i);return a+i+_(s)}function ae(t){var e=z(t);return $(it("0x"+e).replace(/^0x/,""))}function ie(t){return Vt(Zt(U(t)))}function ce(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=$(t,e),o=Zt(r);return Vt(o)}function pe(){var t=Yt(),e=ne(t),r=Zt(t);return{privateKey:z(t),publicKey:z(e),address:{base58:Vt(r),hex:z(r)}}}function le(t){if(Sr.isObject(t)||(t={}),t.path||(t.path="m/44'/195'/0'/0/0"),!String(t.path).match(/^m\/44\'\/195\'/))throw new Error("Invalid tron path provided");var e=st.Wallet.createRandom(t);return{mnemonic:e.mnemonic,privateKey:e.privateKey,publicKey:e.publicKey,address:ce(e.privateKey.replace(/^0x/,""))}}function ue(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";if(e||(e="m/44'/195'/0'/0/0"),!String(e).match(/^m\/44\'\/195\'/))throw new Error("Invalid tron path provided");var o=st.Wallet.fromMnemonic(t,e,r),n={mnemonic:o.mnemonic,privateKey:o.privateKey,publicKey:o.publicKey,address:ce(o.privateKey.replace(/^0x/,""))};return n}var de=new dt;function ge(t){return To.address.toHex(t).replace(V,"0x")}function he(t){if("[object Object]"!==Object.prototype.toString.call(t)&&"[object Array]"!==Object.prototype.toString.call(t))return t;var e,r=(e=t,Array.isArray(e)?[]:{});return Object.keys(t).forEach((function(e){return r[e]=t[e]instanceof Object&&!t[e]._isBigNumber?he(t[e]):t[e]})),r}function fe(t,e,r,o){if(r&&"boolean"!=typeof r||(o=r,r=e,e=t,t=[]),o&&r.replace(/^0x/,"").length%64==8&&(r="0x"+r.replace(/^0x/,"").substring(8)),r.replace(/^0x/,"").length%64)throw new Error("The encoded string is not valid. Its length must be a multiple of 64.");return e=e.map((function(t){return/trcToken/.test(t)&&(t=t.replace(/trcToken/,"uint256")),t})),de.decode(e,r).reduce((function(r,o,n){return"address"==e[n]&&(o="41"+o.substr(2).toLowerCase()),t.length?r[t[n]]=o:r.push(o),r}),t.length?{}:[])}function ye(t,e){for(var r=0;r<t.length;r++)"address"===t[r]&&(e[r]=To.address.toHex(e[r]).replace(V,"0x"));return de.encode(t,e)}function ve(t){var e=t.match(/([a-zA-Z0-9])(\[.*\])/);return e?e[2]:""}function me(t){return(ve(t).match(/\]\[/g)||[]).length+1}function Ae(t,e){var r=[],o=function t(e){if(e&&0===e.type.indexOf("tuple")&&e.components){var r=e.components.map((function(e){return t(e)}));return"tuple(".concat(r.join(","),")").concat(ve(e.type))}return/trcToken/.test(e.type)?e.type.replace(/trcToken/,"uint256"):e.type},n=function t(e){return Array.isArray(e)?(e.forEach((function(r,o){e[o]=t(r)})),e):ge(e)},s=function t(e,r,o){o>1?r.length&&r.forEach((function(r){t(e,r,o-1)})):r.length&&o&&r.forEach((function(t){a(e,t)}))},a=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;e.length&&e.forEach((function(e,o){var a=e.type;if(r[o])if("address"===a)r[o]=ge(r[o]);else if("address["===a.match(/^([^\x5b]*)(\x5b|$)/)[0])n(r[o]);else if(0===a.indexOf("tuple"))if(ve(a)){var i=me(a);s(e.components,r[o],i)}else t(e.components,r[o])}))};if(t.inputs&&t.inputs.length)for(var i=0;i<t.inputs.length;i++){var c=t.inputs[i].type;"bool"===c&&"false"===e[i]&&(e[i]=!1),r.push(0===c.indexOf("tuple")?o(t.inputs[i]):c),e.length<r.length&&e.push("")}return a(t.inputs,e),function(t){for(var e=0;e<t.length;e++){var r=t[e];/trcToken/.test(r)&&(t[e]=r.replace(/trcToken/,"uint256"))}}(r),de.encode(r,e)}function Be(t,e){var r=function t(e){return Array.isArray(e)?(e.forEach((function(r,o){e[o]=t(r)})),e):To.address.toHex(e)},o=function t(e,r,o){o>1?r.length&&r.forEach((function(r){t(e,r,o-1)})):r.length&&o&&r.forEach((function(t){s(e,t)}))},n=function t(e){var r=e.name?" ".concat(e.name):"";if(e&&0===e.type.indexOf("tuple")&&e.components){var o=e.components.map((function(e){return t(e)}));return"tuple(".concat(o.join(","),")").concat(ve(e.type)).concat(r)}return/trcToken/.test(e.type)?e.type.replace(/trcToken/,"uint256")+r:e.type+r},s=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;e.length&&e.forEach((function(e,s){var a=e.type,i=e.name;if(n[s])if("address"===a)n[s]=To.address.toHex(n[s]),i&&(n[i]=To.address.toHex(n[i]));else if("address["===a.match(/^([^\x5b]*)(\x5b|$)/)[0])r(n[s]),i&&r(n[i]);else if(0===a.indexOf("tuple")){if(ve(a)){var c=me(a);o(e.components,n[s],c)}else t(e.components,n[s]);i&&(n[i]=n[s])}}))};if(t.outputs&&t.outputs.length>0){for(var a=[],i=0;i<t.outputs.length;i++){var c=t.outputs[i].type,p=t.outputs[i].name?" ".concat(t.outputs[i].name):"";a.push(0===c.indexOf("tuple")?n(t.outputs[i]):c+p)}!function(t){for(var e=0;e<t.length;e++){var r=t[e];/^trcToken/.test(r)&&(t[e]=r.replace(/^trcToken/,"uint256"))}}(a),e&&e.length||(e=new Uint8Array(32*t.outputs.length));var l=he(de.decode(a,e));return s(t.outputs,l),l}return[]}var be="TRON Signed Message:\n";function Ce(t){return"string"==typeof t&&(t=ct(t)),at(mt([ct(be),ct(String(t.length)),t]))}function we(t,e){e.match(/^0x/)||(e="0x"+e);var r=new ut(e),o=Ce(t),n=r.signDigest(o);return vt(n)}function Te(t,e){return e.match(/^0x/)||(e="0x"+e),Vt($(lt(Ce(t),e).replace(/^0x/,"41")))}function Fe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function Ie(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Fe(Object(r),!0).forEach((function(e){W()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Me=r(31),ke=r(20),We=ke.Transaction,Oe=ke.Permission,Ee=ke.Key,Pe=r(33),xe=Pe.TransferContract,Re=Pe.FreezeBalanceContract,_e=Pe.UnfreezeBalanceContract,Se=Pe.WithdrawBalanceContract,De=Pe.FreezeBalanceV2Contract,ze=Pe.UnfreezeBalanceV2Contract,Ue=Pe.WithdrawExpireUnfreezeContract,Ne=Pe.DelegateResourceContract,je=Pe.UnDelegateResourceContract,Le=r(34),Ve=Le.TransferAssetContract,Ge=Le.ParticipateAssetIssueContract,qe=Le.AssetIssueContract,He=Le.UpdateAssetContract,Ke=r(35),Je=Ke.TriggerSmartContract,$e=Ke.ClearABIContract,Ye=Ke.UpdateEnergyLimitContract,Qe=Ke.UpdateSettingContract,Ze=Ke.CreateSmartContract,Xe=Ke.SmartContract,tr=r(21).ResourceCode,er=r(36),rr=er.WitnessCreateContract,or=er.VoteWitnessContract,nr=r(37).UpdateBrokerageContract,sr=r(38),ar=sr.AccountCreateContract,ir=sr.AccountUpdateContract,cr=sr.SetAccountIdContract,pr=sr.AccountPermissionUpdateContract,lr=r(39),ur=lr.ProposalCreateContract,dr=lr.ProposalDeleteContract,gr=lr.ProposalApproveContract,hr=r(40),fr=hr.ExchangeCreateContract,yr=hr.ExchangeInjectContract,vr=hr.ExchangeWithdrawContract,mr=hr.ExchangeTransactionContract,Ar=function(t){return t&&0!==t.length?new Uint8Array(To.address.toHex(t).match(/.{1,2}/g).map((function(t){return parseInt(t,16)}))):new Uint8Array([])},Br=function(t,e,r,o){var n=new Me.Any;n.pack(t.serializeBinary(),"protocol."+r);var s=new We.Contract;s.setType(e),s.setParameter(n),o&&s.setPermissionId(o);var a=new We.raw;a.addContract(s);var i=new We;return i.setRawData(a),i},br=function(t,e){var r=new Je,o=t.owner_address,n=t.contract_address,s=t.parameter,a=void 0===s?"":s,i=t.function_selector,c=t.call_value,p=t.call_token_value,l=t.token_id,u=t.data;if(r.setOwnerAddress(Ar(o)),r.setContractAddress(Ar(n)),r.setCallValue(c),u)r.setData(Ar(u));else if(i){var d=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e?"0x":"")+at(Buffer.from(t,"utf-8")).toString().substring(2)}(i).substring(2,10)+a;r.setData(Ar(d))}return l&&r.setTokenId(l),p&&r.setCallTokenValue(p),Br(r,We.Contract.ContractType.TRIGGERSMARTCONTRACT,"TriggerSmartContract",e.Permission_id)},Cr=function(t,e){var r=new pr,o=t.owner_address,n=t.owner,s=t.witness,a=t.actives;r.setOwnerAddress(Ar(o));var i=function(t){var e=new Oe,r=t.type,o=t.id,n=t.permission_name,s=t.threshold,a=t.parentId,i=t.operations,c=t.keys;return e.setType(function(t){return isNaN(t)?"Active"===t?2:"Witness"===t?1:0:t}(r)),e.setId(o),e.setPermissionName(n),e.setThreshold(s),a&&e.setParentId(a),i&&e.setOperations(Ar(i)),c&&e.setKeysList(c.map((function(t){var e=new Ee;return e.setAddress(Ar(t.address)),e.setWeight(t.weight),e}))),e};return n&&r.setOwner(i(n)),s&&r.setWitness(i(s)),a&&(Array.isArray(a)?r.setActivesList(a.map((function(t){return i(t)}))):r.setActivesList([i(a)])),Br(r,We.Contract.ContractType.ACCOUNTPERMISSIONUPDATECONTRACT,"AccountPermissionUpdateContract",e.Permission_id)},wr=function(t,e,r){switch(t.type){case"TransferContract":return function(t,e){var r=t.to_address,o=t.owner_address,n=t.amount,s=new xe;return s.setToAddress(Ar(r)),s.setOwnerAddress(Ar(o)),s.setAmount(n),Br(s,We.Contract.ContractType.TRANSFERCONTRACT,"TransferContract",e.Permission_id)}(e,r);case"TransferAssetContract":return function(t,e){var r=t.to_address,o=t.owner_address,n=t.amount,s=t.asset_name,a=new Ve;return a.setToAddress(Ar(r)),a.setOwnerAddress(Ar(o)),a.setAssetName(Ar(s.replace(/^0x/,""))),a.setAmount(n),Br(a,We.Contract.ContractType.TRANSFERASSETCONTRACT,"TransferAssetContract",e.Permission_id)}(e,r);case"ParticipateAssetIssueContract":return function(t,e){var r=new Ge;return r.setToAddress(Ar(t.to_address)),r.setOwnerAddress(Ar(t.owner_address)),r.setAssetName(Ar(t.asset_name.replace(/^0x/,""))),r.setAmount(t.amount),Br(r,We.Contract.ContractType.PARTICIPATEASSETISSUECONTRACT,"ParticipateAssetIssueContract",e.Permission_id)}(e,r);case"TriggerSmartContract":return br(e,r);case"FreezeBalanceContract":return function(t,e){var r=new Re,o=t.owner_address,n=t.frozen_balance,s=t.frozen_duration,a=t.resource,i=t.receiver_address;return r.setOwnerAddress(Ar(o)),r.setFrozenBalance(n),r.setFrozenDuration(s),a&&r.setResource(tr[a]),i&&r.setReceiverAddress(Ar(i)),Br(r,We.Contract.ContractType.FREEZEBALANCECONTRACT,"FreezeBalanceContract",e.Permission_id)}(e,r);case"UnfreezeBalanceContract":return function(t,e){var r=new _e,o=t.owner_address,n=t.resource,s=t.receiver_address;return r.setOwnerAddress(Ar(o)),n&&r.setResource(tr[n]),s&&r.setReceiverAddress(Ar(s)),Br(r,We.Contract.ContractType.UNFREEZEBALANCECONTRACT,"UnfreezeBalanceContract",e.Permission_id)}(e,r);case"WithdrawBalanceContract":return function(t,e){var r=new Se,o=t.owner_address;return r.setOwnerAddress(Ar(o)),Br(r,We.Contract.ContractType.WITHDRAWBALANCECONTRACT,"WithdrawBalanceContract",e.Permission_id)}(e,r);case"FreezeBalanceV2Contract":return function(t,e){var r=new De,o=t.owner_address,n=t.frozen_balance,s=t.resource;return r.setOwnerAddress(Ar(o)),r.setFrozenBalance(n),r.setResource(tr[s]),Br(r,We.Contract.ContractType.FREEZEBALANCEV2CONTRACT,"FreezeBalanceV2Contract",e.Permission_id)}(e,r);case"UnfreezeBalanceV2Contract":return function(t,e){var r=new ze,o=t.owner_address,n=t.unfreeze_balance,s=t.resource;return r.setOwnerAddress(Ar(o)),r.setUnfreezeBalance(n),r.setResource(tr[s]),Br(r,We.Contract.ContractType.UNFREEZEBALANCEV2CONTRACT,"UnfreezeBalanceV2Contract",e.Permission_id)}(e,r);case"DelegateResourceContract":return function(t,e){var r=new Ne,o=t.owner_address,n=t.receiver_address,s=t.balance,a=t.resource,i=t.lock,c=void 0!==i&&i;return r.setOwnerAddress(Ar(o)),r.setBalance(s),r.setResource(tr[a]),r.setLock(c),r.setReceiverAddress(Ar(n)),Br(r,We.Contract.ContractType.DELEGATERESOURCECONTRACT,"DelegateResourceContract",e.Permission_id)}(e,r);case"UnDelegateResourceContract":return function(t,e){var r=new je,o=t.owner_address,n=t.receiver_address,s=t.balance,a=t.resource;return r.setOwnerAddress(Ar(o)),r.setBalance(s),r.setResource(tr[a]),r.setReceiverAddress(Ar(n)),Br(r,We.Contract.ContractType.UNDELEGATERESOURCECONTRACT,"UnDelegateResourceContract",e.Permission_id)}(e,r);case"WithdrawExpireUnfreezeContract":return function(t,e){var r=new Ue,o=t.owner_address;return r.setOwnerAddress(Ar(o)),Br(r,We.Contract.ContractType.WITHDRAWEXPIREUNFREEZECONTRACT,"WithdrawExpireUnfreezeContract",e.Permission_id)}(e,r);case"WitnessCreateContract":return function(t,e){var r=new rr,o=t.owner_address,n=t.url;return r.setOwnerAddress(Ar(o)),r.setUrl(Ar(n.replace(/^0x/,""))),Br(r,We.Contract.ContractType.WITNESSCREATECONTRACT,"WitnessCreateContract",e.Permission_id)}(e,r);case"VoteWitnessContract":return function(t,e){var r=new or,o=t.owner_address,n=t.votes;return r.setOwnerAddress(Ar(o)),n.forEach((function(t){var e=new or.Vote,o=t.vote_address,n=t.vote_count;e.setVoteAddress(Ar(o));var s=parseInt(n);e.setVoteCount(s),r.addVotes(e)})),Br(r,We.Contract.ContractType.VOTEWITNESSCONTRACT,"VoteWitnessContract",e.Permission_id)}(e,r);case"CreateSmartContract":return function(t,e){var r=null!=t&&t.new_contract?Ie(Ie({},{owner_address:t.owner_address,call_token_value:t.call_token_value,token_id:t.token_id}),t.new_contract):t,o=r.owner_address,n=r.consume_user_resource_percent,s=r.origin_energy_limit,a=r.abi,i=r.bytecode,c=void 0===i?"":i,p=r.name,l=r.parameter,u=void 0===l?"":l,d=r.call_value,g=r.call_token_value,h=r.token_id,f=r.origin_address,y=new Ze;y.setOwnerAddress(Ar(o)),h&&y.setTokenId(h),g&&y.setCallTokenValue(g);var v=new Xe;if(a){var m;m="string"==typeof a?JSON.parse(a):(null==a?void 0:a.entrys)||[];var A=new Xe.ABI,B=function(t){var e=new Xe.ABI.Entry.Param,r=t.indexed,o=t.name,n=t.type;return!0===r&&e.setIndexed(!0),e.setName(o),e.setType(n),e},b=m.map((function(t){var e=t.anonymous,r=t.constant,o=t.name,n=t.inputs,s=t.outputs,a=t.type,i=t.payable,c=t.stateMutability,p=new Xe.ABI.Entry;return p.setAnonymous(e),p.setConstant(r),p.setName(o),n&&p.setInputsList(n.map((function(t){return B(t)}))),s&&p.setOutputsList(s.map((function(t){return B(t)}))),a&&p.setType(Xe.ABI.Entry.EntryType[a.toUpperCase()]),p.setPayable(i),c&&p.setStatemutability(Xe.ABI.Entry.StateMutabilityType[c.toUpperCase()]),p}));A.setEntrysList(b),v.setAbi(A)}if(d&&v.setCallValue(d),v.setConsumeUserResourcePercent(n),v.setOriginEnergyLimit(s),f||(f=o),v.setOriginAddress(Ar(f)),c){var C=c.replace(/^0x/,"")+u.replace(/^0x/,"");v.setBytecode(Ar(C))}return v.setName(p),y.setNewContract(v),Br(y,We.Contract.ContractType.CREATESMARTCONTRACT,"CreateSmartContract",e.Permission_id)}(e,r);case"ClearABIContract":return function(t,e){var r=t.contract_address,o=t.owner_address,n=new $e;return n.setOwnerAddress(Ar(o)),n.setContractAddress(Ar(r)),Br(n,We.Contract.ContractType.CLEARABICONTRACT,"ClearABIContract")}(e);case"UpdateBrokerageContract":return function(t,e){var r=t.brokerage,o=t.owner_address,n=new nr;return n.setOwnerAddress(Ar(o)),n.setBrokerage(r),Br(n,We.Contract.ContractType.UPDATEBROKERAGECONTRACT,"UpdateBrokerageContract")}(e);case"AssetIssueContract":return function(t,e){var r=t.owner_address,o=t.name,n=t.abbr,s=t.description,a=t.url,i=t.total_supply,c=t.trx_num,p=t.num,l=t.start_time,u=t.end_time,d=t.precision,g=t.free_asset_net_limit,h=t.public_free_asset_net_limit,f=t.public_free_asset_net_usage,y=void 0===f?0:f,v=t.public_latest_free_net_time,m=void 0===v?0:v,A=t.vote_score,B=void 0===A?0:A,b=t.frozen_supply,C=new qe;if(C.setOwnerAddress(Ar(r)),o&&C.setName(Ar(o.replace(/^0x/,""))),n&&C.setAbbr(Ar(n.replace(/^0x/,""))),C.setTotalSupply(i),C.setNum(p),C.setEndTime(u),C.setStartTime(l),C.setTrxNum(c),C.setVoteScore(B),d&&C.setPrecision(d),m&&C.setPublicLatestFreeNetTime(m),s&&C.setDescription(Ar(s.replace(/^0x/,""))),a&&C.setUrl(Ar(a.replace(/^0x/,""))),C.setPublicFreeAssetNetUsage(y),C.setFreeAssetNetLimit(g),C.setPublicFreeAssetNetLimit(h),b){var w=new qe.FrozenSupply;w.setFrozenAmount(b.length?b[0].frozen_amount:b.frozen_amount),w.setFrozenDays(b.length?b[0].frozen_days:b.frozen_days),C.addFrozenSupply(w)}return Br(C,We.Contract.ContractType.ASSETISSUECONTRACT,"AssetIssueContract",e.Permission_id)}(e,r);case"AccountCreateContract":return function(t,e){var r=new ar,o=t.account_address,n=t.owner_address;return r.setOwnerAddress(Ar(n)),r.setAccountAddress(Ar(o.replace(/^0x/,""))),Br(r,We.Contract.ContractType.ACCOUNTCREATECONTRACT,"AccountCreateContract",e.Permission_id)}(e,r);case"AccountUpdateContract":return function(t,e){var r=new ir,o=t.account_name,n=t.owner_address;return r.setOwnerAddress(Ar(n)),r.setAccountName(Ar(o.replace(/^0x/,""))),Br(r,We.Contract.ContractType.ACCOUNTUPDATECONTRACT,"AccountUpdateContract",e.Permission_id)}(e,r);case"SetAccountIdContract":return function(t,e){var r=new cr,o=t.account_id,n=t.owner_address;return r.setOwnerAddress(Ar(n)),r.setAccountId(Ar(o.replace(/^0x/,""))),Br(r,We.Contract.ContractType.SETACCOUNTIDCONTRACT,"SetAccountIdContract",e.Permission_id)}(e,r);case"ProposalCreateContract":return function(t,e){var r=new ur,o=t.owner_address,n=t.parameters;return r.setOwnerAddress(Ar(o)),n.forEach((function(t){r.getParametersMap().set(t.key,t.value)})),Br(r,We.Contract.ContractType.PROPOSALCREATECONTRACT,"ProposalCreateContract",e.Permission_id)}(e,r);case"ProposalDeleteContract":return function(t,e){var r=new dr,o=t.owner_address,n=t.proposal_id;return r.setOwnerAddress(Ar(o)),r.setProposalId(n),Br(r,We.Contract.ContractType.PROPOSALDELETECONTRACT,"ProposalDeleteContract",e.Permission_id)}(e,r);case"ProposalApproveContract":return function(t,e){var r=new gr,o=t.owner_address,n=t.proposal_id,s=t.is_add_approval;return r.setOwnerAddress(Ar(o)),r.setProposalId(n),r.setIsAddApproval(s),Br(r,We.Contract.ContractType.PROPOSALAPPROVECONTRACT,"ProposalApproveContract",e.Permission_id)}(e,r);case"ExchangeCreateContract":return function(t,e){var r=new fr,o=t.owner_address,n=t.first_token_id,s=t.first_token_balance,a=t.second_token_id,i=t.second_token_balance;return r.setOwnerAddress(Ar(o)),r.setFirstTokenId(Ar(n.replace(/^0x/,""))),r.setFirstTokenBalance(s),r.setSecondTokenId(Ar(a.replace(/^0x/,""))),r.setSecondTokenBalance(i),Br(r,We.Contract.ContractType.EXCHANGECREATECONTRACT,"ExchangeCreateContract",e.Permission_id)}(e,r);case"ExchangeInjectContract":return function(t,e){var r=new yr,o=t.owner_address,n=t.exchange_id,s=t.token_id,a=t.quant;return r.setOwnerAddress(Ar(o)),r.setExchangeId(n),r.setTokenId(Ar(s.replace(/^0x/,""))),r.setQuant(a),Br(r,We.Contract.ContractType.EXCHANGEINJECTCONTRACT,"ExchangeInjectContract",e.Permission_id)}(e,r);case"ExchangeWithdrawContract":return function(t,e){var r=new vr,o=t.owner_address,n=t.exchange_id,s=t.token_id,a=t.quant;return r.setOwnerAddress(Ar(o)),r.setExchangeId(n),r.setTokenId(Ar(s.replace(/^0x/,""))),r.setQuant(a),Br(r,We.Contract.ContractType.EXCHANGEWITHDRAWCONTRACT,"ExchangeWithdrawContract",e.Permission_id)}(e,r);case"ExchangeTransactionContract":return function(t,e){var r=new mr,o=t.owner_address,n=t.exchange_id,s=t.token_id,a=t.quant,i=t.expected;return r.setOwnerAddress(Ar(o)),r.setExchangeId(n),r.setTokenId(Ar(s.replace(/^0x/,""))),r.setQuant(a),r.setExpected(i),Br(r,We.Contract.ContractType.EXCHANGETRANSACTIONCONTRACT,"ExchangeTransactionContract",e.Permission_id)}(e,r);case"UpdateSettingContract":return function(t,e){var r=new Qe,o=t.owner_address,n=t.contract_address,s=t.consume_user_resource_percent;return r.setOwnerAddress(Ar(o)),r.setContractAddress(Ar(n)),r.setConsumeUserResourcePercent(s),Br(r,We.Contract.ContractType.UPDATESETTINGCONTRACT,"UpdateSettingContract",e.Permission_id)}(e,r);case"UpdateEnergyLimitContract":return function(t,e){var r=new Ye,o=t.owner_address,n=t.contract_address,s=t.origin_energy_limit;return r.setOwnerAddress(Ar(o)),r.setContractAddress(Ar(n)),r.setOriginEnergyLimit(s),Br(r,We.Contract.ContractType.UPDATEENERGYLIMITCONTRACT,"UpdateEnergyLimitContract",e.Permission_id)}(e,r);case"AccountPermissionUpdateContract":return Cr(e,r);case"UpdateAssetContract":return function(t,e){var r=new He,o=t.owner_address,n=t.description,s=t.url,a=t.new_limit,i=t.new_public_limit;return r.setOwnerAddress(Ar(o)),n&&r.setDescription(Ar(n.replace(/^0x/,""))),s&&r.setUrl(Ar(s.replace(/^0x/,""))),a&&r.setNewLimit(a),i&&r.setNewPublicLimit(i),Br(r,We.Contract.ContractType.UPDATEASSETCONTRACT,"UpdateAssetContract",e.Permission_id)}(e,r)}},Tr=function(t){var e=t.raw_data,r=e.contract[0],o=r.parameter.value,n={Permission_id:r.Permission_id},s=wr(r,o,n),a=s.getRawData();return a.setRefBlockBytes(Ar(e.ref_block_bytes)),a.setRefBlockHash(Ar(e.ref_block_hash)),e.data&&a.setData(Ar(e.data)),e.fee_limit&&a.setFeeLimit(e.fee_limit),e.expiration&&a.setExpiration(e.expiration),e.timestamp&&a.setTimestamp(e.timestamp),s.setRawData(a),s},Fr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.raw_data,n=o.contract[0],s=wr(n,e,{Permission_id:null==e?void 0:e.Permission_id}),a=s.getRawData();return a.setRefBlockBytes(Ar(o.ref_block_bytes)),a.setRefBlockHash(Ar(o.ref_block_hash)),r.data&&a.setData(Ar(r.data.replace(/^0x/,""))),(r.fee_limit||e.fee_limit)&&a.setFeeLimit(r.fee_limit||e.fee_limit),o.expiration&&a.setExpiration(o.expiration),o.timestamp&&a.setTimestamp(o.timestamp),s.setRawData(a),s},Ir=function(t,e){var r=e.getRawData().serializeBinary(),o=z(r),n=it(r);return o.toLowerCase()===t.raw_data_hex.toLowerCase()&&n.replace(/^0x/,"").toLowerCase()===t.txID.replace(/^0x/,"").toLowerCase()},Mr=function(t){var e=Tr(t);return Ir(t,e)},kr=function(t,e,r){var o=Fr(t,e,r);return Ir(t,o)},Wr=function(t){var e=t.getRawData().serializeBinary();return it(e)},Or=r(27),Er=r.n(Or),Pr=r(14),xr=r.n(Pr);function Rr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function _r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Rr(Object(r),!0).forEach((function(e){W()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Sr=_r(_r({},{isValidURL:function(t){return"string"==typeof t&&Er.a.isURL(t.toString(),{protocols:["http","https"],require_tld:!1})},isObject:function(t){return t===Object(t)&&"[object Array]"!==Object.prototype.toString.call(t)},isArray:function(t){return Array.isArray(t)},isJson:function(t){try{return!!JSON.parse(t)}catch(t){return!1}},isBoolean:function(t){return"boolean"==typeof t},isBigNumber:function(t){return t&&(t instanceof xr.a||t.constructor&&"BigNumber"===t.constructor.name)},isString:function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},isFunction:function(t){return"function"==typeof t},isHex:function(t){return"string"==typeof t&&!isNaN(parseInt(t,16))&&/^(0x|)[a-fA-F0-9]+$/.test(t)},isInteger:function(t){return null!==t&&Number.isInteger(Number(t))},hasProperty:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},hasProperties:function(t){for(var e=this,r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return o.length&&!o.map((function(r){return e.hasProperty(t,r)})).includes(!1)},mapEvent:function(t){var e={block:t.block_number,timestamp:t.block_timestamp,contract:t.contract_address,name:t.event_name,transaction:t.transaction_id,result:t.result,resourceNode:t.resource_Node||(t._unconfirmed?"fullNode":"solidityNode")};return t._unconfirmed&&(e.unconfirmed=t._unconfirmed),t._fingerprint&&(e.fingerprint=t._fingerprint),e},parseEvent:function(t,e){var r=e.inputs;if(!t.result)return t;if(this.isObject(t.result))for(var o=0;o<r.length;o++){var n=r[o];"address"==n.type&&n.name in t.result&&(t.result[n.name]="41"+t.result[n.name].substr(2).toLowerCase())}else this.isArray(t.result)&&(t.result=t.result.reduce((function(t,e,o){var n=r[o],s=n.name;return"address"==n.type&&(e="41"+e.substr(2).toLowerCase()),t[s]=e,t}),{}));return t},padLeft:function(t,e,r){for(var o=t.toString();o.length<r;)o=e+o;return o},isNotNullOrUndefined:function(t){return null!=t},sleep:function(){var t=arguments;return g()(E.a.mark((function e(){var r;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.length>0&&void 0!==t[0]?t[0]:1e3,e.abrupt("return",new Promise((function(t){return setTimeout(t,r)})));case 2:case"end":return e.stop()}}),e)})))()}}),{},{code:n,accounts:c,base58:s,bytes:o,crypto:i,abi:p,message:l,_TypedDataEncoder:Lt,transaction:u,ethersUtils:a}),Dr={HttpProvider:function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e4,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"/";if(v()(this,t),!Sr.isValidURL(e))throw new Error("Invalid URL provided to HttpProvider");if(isNaN(r)||r<0)throw new Error("Invalid timeout duration provided");if(!Sr.isObject(s))throw new Error("Invalid headers object provided");e=e.replace(/\/+$/,""),this.host=e,this.timeout=r,this.user=o,this.password=n,this.headers=s,this.statusPage=a,this.instance=x.a.create({baseURL:e,timeout:r,headers:s,auth:o&&{user:o,password:n}})}var e;return A()(t,[{key:"setStatusPage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";this.statusPage=t}},{key:"isConnected",value:(e=g()(E.a.mark((function t(){var e,r=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:this.statusPage,t.abrupt("return",this.request(e).then((function(t){return Sr.hasProperties(t,"blockID","block_header")})).catch((function(){return!1})));case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"request",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"get";return r=r.toLowerCase(),this.instance.request({data:"post"==r&&Object.keys(e).length?e:null,params:"get"==r&&e,url:t,method:r}).then((function(t){return t.data}))}}]),t}()},zr=r(28),Ur=r.n(zr),Nr=r(29),jr=r(17),Lr=r.n(jr),Vr=r(7),Gr=r.n(Vr),qr=r(12),Hr=r.n(qr);function Kr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Jr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jr(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,n=function(){};return{s:n,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw s}}}}function Jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}var $r,Yr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v()(this,t),!e||!e instanceof To)throw new Error("Expected instance of TronWeb");this.tronWeb=e}return A()(t,[{key:"invalid",value:function(t){return t.msg||"Invalid ".concat(t.name).concat("address"===t.type?" address":""," provided")}},{key:"notPositive",value:function(t){return"".concat(t.name," must be a positive integer")}},{key:"notEqual",value:function(t){return t.msg||"".concat(t.names[0]," can not be equal to ").concat(t.names[1])}},{key:"notValid",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Function,o={},n=!1,s=Kr(e);try{for(s.s();!(t=s.n()).done;){var a=t.value,i=a.name,c=a.names,p=a.value,l=a.type,u=a.gt,d=a.lt,g=a.gte,h=a.lte,f=(a.se,a.optional);if(!f||Sr.isNotNullOrUndefined(p)&&("boolean"===l||!1!==p)){switch(o[a.name]=a.value,l){case"address":this.tronWeb.isAddress(p)?o[i]=this.tronWeb.address.toHex(p):n=!0;break;case"integer":(!Sr.isInteger(p)||"number"==typeof u&&p<=a.gt||"number"==typeof d&&p>=a.lt||"number"==typeof g&&p<a.gte||"number"==typeof h&&p>a.lte)&&(n=!0);break;case"positive-integer":if(!Sr.isInteger(p)||p<=0)return void r(this.notPositive(a));break;case"tokenId":Sr.isString(p)&&p.length||(n=!0);break;case"notEmptyObject":Sr.isObject(p)&&Object.keys(p).length||(n=!0);break;case"notEqual":if(o[c[0]]===o[c[1]])return r(this.notEqual(a)),!0;break;case"resource":["BANDWIDTH","ENERGY"].includes(p)||(n=!0);break;case"url":Sr.isValidURL(p)||(n=!0);break;case"hex":Sr.isHex(p)||(n=!0);break;case"array":Array.isArray(p)||(n=!0);break;case"not-empty-string":Sr.isString(p)&&p.length||(n=!0);break;case"boolean":Sr.isBoolean(p)||(n=!0);break;case"string":(!Sr.isString(p)||"number"==typeof u&&p.length<=a.gt||"number"==typeof d&&p.length>=a.lt||"number"==typeof g&&p.length<a.gte||"number"==typeof h&&p.length>a.lte)&&(n=!0)}if(n)return r(this.invalid(a)),!0}}}catch(t){s.e(t)}finally{s.f()}return!1}}]),t}();function Qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function Zr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qr(Object(r),!0).forEach((function(e){W()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Xr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return to(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return to(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,n=function(){};return{s:n,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw s}}}}function to(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function eo(t){return To.address.toHex(t)}function ro(t){return $r.tronWeb.fromUtf8(t)}function oo(t,e,r,o){return"function"==typeof r&&(o=r),"function"==typeof e&&(o=e,e=null),t.Error?o(t.Error):t.result&&t.result.message?o($r.tronWeb.toUtf8(t.result.message)):kr(t,e,r)?o(null,t):o("Invalid transaction")}function no(t,e,r,o){return t.Error?o(t.Error):t.result&&t.result.message?o($r.tronWeb.toUtf8(t.result.message)):r._isConstant||r.estimateEnergy||kr(t.transaction,e,r)?o(null,t):o("Invalid transaction")}var so=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v()(this,t),!e||!e instanceof To)throw new Error("Expected instance of TronWeb");$r=this,this.tronWeb=e,this.injectPromise=Gr()(this),this.validator=new Yr(e)}var e,r,o,n;return A()(t,[{key:"sendTrx",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)?(n=r,r=this.tronWeb.defaultAddress.hex):Sr.isObject(r)&&(o=r,r=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.sendTrx,t,e,r,o);if(e=parseInt(e),!this.validator.notValid([{name:"recipient",type:"address",value:t},{name:"origin",type:"address",value:r},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer TRX to the same account"},{name:"amount",type:"integer",gt:0,value:e}],n)){var s={to_address:eo(t),owner_address:eo(r),amount:e};o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/createtransaction",s,"post").then((function(t){return oo(t,s,n)})).catch((function(t){return n(t)}))}}},{key:"sendToken",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,n=arguments.length>4?arguments[4]:void 0,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Sr.isFunction(n)&&(s=n,n={}),Sr.isFunction(o)?(s=o,o=this.tronWeb.defaultAddress.hex):Sr.isObject(o)&&(n=o,o=this.tronWeb.defaultAddress.hex),!s)return this.injectPromise(this.sendToken,t,e,r,o,n);if(e=parseInt(e),!this.validator.notValid([{name:"recipient",type:"address",value:t},{name:"origin",type:"address",value:o},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer tokens to the same account"},{name:"amount",type:"integer",gt:0,value:e},{name:"token ID",type:"tokenId",value:r}],s)){var a={to_address:eo(t),owner_address:eo(o),asset_name:ro(r),amount:parseInt(e)};n&&n.permissionId&&(a.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/transferasset",a,"post").then((function(t){return oo(t,a,n,s)})).catch((function(t){return s(t)}))}}},{key:"purchaseToken",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,n=arguments.length>4?arguments[4]:void 0,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Sr.isFunction(n)&&(s=n,n={}),Sr.isFunction(o)?(s=o,o=this.tronWeb.defaultAddress.hex):Sr.isObject(o)&&(n=o,o=this.tronWeb.defaultAddress.hex),!s)return this.injectPromise(this.purchaseToken,t,e,r,o,n);if(!this.validator.notValid([{name:"buyer",type:"address",value:o},{name:"issuer",type:"address",value:t},{names:["buyer","issuer"],type:"notEqual",msg:"Cannot purchase tokens from same account"},{name:"amount",type:"integer",gt:0,value:r},{name:"token ID",type:"tokenId",value:e}],s)){var a={to_address:eo(t),owner_address:eo(o),asset_name:ro(e),amount:parseInt(r)};n&&n.permissionId&&(a.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/participateassetissue",a,"post").then((function(t){return oo(t,a,n,s)})).catch((function(t){return s(t)}))}}},{key:"freezeBalance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"BANDWIDTH",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Sr.isFunction(s)&&(a=s,s={}),Sr.isFunction(n)?(a=n,n=void 0):Sr.isObject(n)&&(s=n,n=void 0),Sr.isFunction(o)?(a=o,o=this.tronWeb.defaultAddress.hex):Sr.isObject(o)&&(s=o,o=this.tronWeb.defaultAddress.hex),Sr.isFunction(e)&&(a=e,e=3),Sr.isFunction(r)&&(a=r,r="BANDWIDTH"),!a)return this.injectPromise(this.freezeBalance,t,e,r,o,n,s);if(!this.validator.notValid([{name:"origin",type:"address",value:o},{name:"receiver",type:"address",value:n,optional:!0},{name:"amount",type:"integer",gt:0,value:t},{name:"duration",type:"integer",gte:3,value:e},{name:"resource",type:"resource",value:r,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}],a)){var i={owner_address:eo(o),frozen_balance:parseInt(t),frozen_duration:parseInt(e),resource:r};Sr.isNotNullOrUndefined(n)&&eo(n)!==eo(o)&&(i.receiver_address=eo(n)),s&&s.permissionId&&(i.Permission_id=s.permissionId),this.tronWeb.fullNode.request("wallet/freezebalance",i,"post").then((function(t){return oo(t,i,s,a)})).catch((function(t){return a(t)}))}}},{key:"unfreezeBalance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BANDWIDTH",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)?(n=r,r=void 0):Sr.isObject(r)&&(o=r,r=void 0),Sr.isFunction(e)?(n=e,e=this.tronWeb.defaultAddress.hex):Sr.isObject(e)&&(o=e,e=this.tronWeb.defaultAddress.hex),Sr.isFunction(t)&&(n=t,t="BANDWIDTH"),!n)return this.injectPromise(this.unfreezeBalance,t,e,r,o);if(!this.validator.notValid([{name:"origin",type:"address",value:e},{name:"receiver",type:"address",value:r,optional:!0},{name:"resource",type:"resource",value:t,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}],n)){var s={owner_address:eo(e),resource:t};Sr.isNotNullOrUndefined(r)&&eo(r)!==eo(e)&&(s.receiver_address=eo(r)),o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/unfreezebalance",s,"post").then((function(t){return oo(t,s,o,n)})).catch((function(t){return n(t)}))}}},{key:"freezeBalanceV2",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"BANDWIDTH",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)?(n=r,r=this.tronWeb.defaultAddress.hex):Sr.isObject(r)&&(o=r,r=this.tronWeb.defaultAddress.hex),Sr.isFunction(e)?(n=e,e="BANDWIDTH"):Sr.isObject(e)&&(o=e,e="BANDWIDTH"),!n)return this.injectPromise(this.freezeBalanceV2,t,e,r,o);if(!this.validator.notValid([{name:"origin",type:"address",value:r},{name:"amount",type:"integer",gt:0,value:t},{name:"resource",type:"resource",value:e,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}],n)){var s={owner_address:eo(r),frozen_balance:parseInt(t),resource:e};o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/freezebalancev2",s,"post").then((function(t){return oo(t,s,o,n)})).catch((function(t){return n(t)}))}}},{key:"unfreezeBalanceV2",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"BANDWIDTH",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)?(n=r,r=this.tronWeb.defaultAddress.hex):Sr.isObject(r)&&(o=r,r=this.tronWeb.defaultAddress.hex),Sr.isFunction(e)?(n=e,e="BANDWIDTH"):Sr.isObject(e)&&(o=e,e="BANDWIDTH"),!n)return this.injectPromise(this.unfreezeBalanceV2,t,e,r,o);if(!this.validator.notValid([{name:"origin",type:"address",value:r},{name:"amount",type:"integer",gt:0,value:t},{name:"resource",type:"resource",value:e,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}],n)){var s={owner_address:eo(r),unfreeze_balance:parseInt(t),resource:e};o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/unfreezebalancev2",s,"post").then((function(t){return oo(t,s,o,n)})).catch((function(t){return n(t)}))}}},{key:"delegateResource",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"BANDWIDTH",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Sr.isFunction(s)&&(a=s,s={}),Sr.isFunction(n)?(a=n,n=!1):Sr.isObject(n)&&(s=n,n=!1),Sr.isFunction(o)?(a=o,o=this.tronWeb.defaultAddress.hex):Sr.isObject(o)&&(s=o,o=this.tronWeb.defaultAddress.hex),Sr.isFunction(r)?(a=r,r="BANDWIDTH"):Sr.isObject(r)&&(s=r,r="BANDWIDTH"),!a)return this.injectPromise(this.delegateResource,t,e,r,o,n,s);if(!this.validator.notValid([{name:"amount",type:"integer",gt:0,value:t},{name:"resource",type:"resource",value:r,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'},{name:"receiver",type:"address",value:e},{name:"origin",type:"address",value:o},{name:"lock",type:"boolean",value:n}],a)){if(eo(e)===eo(o))return a("Receiver address must not be the same as owner address");var i={owner_address:eo(o),receiver_address:eo(e),balance:parseInt(t),resource:r,lock:n};s&&s.permissionId&&(i.Permission_id=s.permissionId),this.tronWeb.fullNode.request("wallet/delegateresource",i,"post").then((function(t){return oo(t,i,s,a)})).catch((function(t){return a(t)}))}}},{key:"undelegateResource",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"BANDWIDTH",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,n=arguments.length>4?arguments[4]:void 0,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Sr.isFunction(n)&&(s=n,n={}),Sr.isFunction(o)?(s=o,o=this.tronWeb.defaultAddress.hex):Sr.isObject(o)&&(n=o,o=this.tronWeb.defaultAddress.hex),Sr.isFunction(r)?(s=r,r="BANDWIDTH"):Sr.isObject(r)&&(n=r,r="BANDWIDTH"),!s)return this.injectPromise(this.undelegateResource,t,e,r,o,n);if(!this.validator.notValid([{name:"origin",type:"address",value:o},{name:"receiver",type:"address",value:e},{name:"amount",type:"integer",gt:0,value:t},{name:"resource",type:"resource",value:r,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}],s)){if(eo(e)===eo(o))return s("Receiver address must not be the same as owner address");var a={owner_address:eo(o),receiver_address:eo(e),balance:parseInt(t),resource:r};n&&n.permissionId&&(a.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/undelegateresource",a,"post").then((function(t){return oo(t,a,n,s)})).catch((function(t){return s(t)}))}}},{key:"withdrawExpireUnfreeze",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)&&(r=e,e={}),Sr.isFunction(t)?(r=t,t=this.tronWeb.defaultAddress.hex):Sr.isObject(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.withdrawExpireUnfreeze,t,e);if(!this.validator.notValid([{name:"origin",type:"address",value:t}],r)){var o={owner_address:eo(t)};e&&e.permissionId&&(o.Permission_id=e.permissionId),this.tronWeb.fullNode.request("wallet/withdrawexpireunfreeze",o,"post").then((function(t){return oo(t,o,e,r)})).catch((function(t){return r(t)}))}}},{key:"withdrawBlockRewards",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)&&(r=e,e={}),Sr.isFunction(t)?(r=t,t=this.tronWeb.defaultAddress.hex):Sr.isObject(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.withdrawBlockRewards,t,e);if(!this.validator.notValid([{name:"origin",type:"address",value:t}],r)){var o={owner_address:eo(t)};e&&e.permissionId&&(o.Permission_id=e.permissionId),this.tronWeb.fullNode.request("wallet/withdrawbalance",o,"post").then((function(t){return oo(t,o,e,r)})).catch((function(t){return r(t)}))}}},{key:"applyForSR",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Sr.isFunction(r)&&(o=r,r={}),Sr.isObject(e)&&Sr.isValidURL(t)&&(r=e,e=t,t=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.applyForSR,t,e,r);if(!this.validator.notValid([{name:"origin",type:"address",value:t},{name:"url",type:"url",value:e,msg:"Invalid url provided"}],o)){var n={owner_address:eo(t),url:ro(e)};r&&r.permissionId&&(n.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/createwitness",n,"post").then((function(t){return oo(t,n,r,o)})).catch((function(t){return o(t)}))}}},{key:"vote",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,o=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)?(n=r,r=this.tronWeb.defaultAddress.hex):Sr.isObject(r)&&(o=r,r=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.vote,e,r,o);if(!this.validator.notValid([{name:"voter",type:"address",value:r},{name:"votes",type:"notEmptyObject",value:e}],n)){var s=!1;if(e=Object.entries(e).map((function(e){var r=Hr()(e,2),o=r[0],n=r[1];if(!s)return t.validator.notValid([{name:"SR",type:"address",value:o},{name:"vote count",type:"integer",gt:0,value:n,msg:"Invalid vote count provided for SR: "+o}])?s=!0:{vote_address:eo(o),vote_count:parseInt(n)}})),!s){var a={owner_address:eo(r),votes:e};o&&o.permissionId&&(a.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/votewitnessaccount",a,"post").then((function(t){return oo(t,a,o,n)})).catch((function(t){return n(t)}))}}}},{key:"createSmartContract",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.createSmartContract,t,e);var o=t.feeLimit||this.tronWeb.feeLimit,n=t.userFeePercentage;"number"==typeof n||n||(n=100);var s=t.originEnergyLimit||1e7,a=t.callValue||0,i=t.tokenValue,c=t.tokenId||t.token_id,p=t.abi,l=void 0!==p&&p,u=t.bytecode,d=void 0!==u&&u,g=t.parameters,h=void 0===g?[]:g,f=t.name,y=void 0===f?"":f;if(l&&Sr.isString(l))try{l=JSON.parse(l)}catch(t){return r("Invalid options.abi provided")}if(l.entrys&&(l=l.entrys),!Sr.isArray(l))return r("Invalid options.abi provided");var v=l.some((function(t){return"constructor"===t.type&&"payable"===t.stateMutability.toLowerCase()}));if(!this.validator.notValid([{name:"bytecode",type:"hex",value:d},{name:"feeLimit",type:"integer",value:o,gt:0},{name:"callValue",type:"integer",value:a,gte:0},{name:"userFeePercentage",type:"integer",value:n,gte:0,lte:100},{name:"originEnergyLimit",type:"integer",value:s,gte:0,lte:1e7},{name:"parameters",type:"array",value:h},{name:"issuer",type:"address",value:e},{name:"tokenValue",type:"integer",value:i,gte:0,optional:!0},{name:"tokenId",type:"integer",value:c,gte:0,optional:!0}],r)){if(v&&0==a&&0==i)return r("When contract is payable, options.callValue or options.tokenValue must be a positive integer");if(!v&&(a>0||i>0))return r("When contract is not payable, options.callValue and options.tokenValue must be 0");if(t.rawParameter&&Sr.isString(t.rawParameter))h=t.rawParameter.replace(/^(0x)/,"");else if(t.funcABIV2)h=Ae(t.funcABIV2,t.parametersV2).replace(/^(0x)/,"");else{var m=l.find((function(t){return"constructor"===t.type}));if(void 0!==m&&m){var A=new dt,B=[],b=[];if(m=m.inputs,h.length!=m.length)return r("constructor needs ".concat(m.length," but ").concat(h.length," provided"));for(var C=0;C<h.length;C++){var w=m[C].type,T=h[C];if(!w||!Sr.isString(w)||!w.length)return r("Invalid parameter type provided: "+w);"address"===w?T=eo(T).replace(V,"0x"):"address["===w.match(/^([^\x5b]*)(\x5b|$)/)[0]?T=T.map((function(t){return eo(t).replace(V,"0x")})):/trcToken/.test(w)&&(w=w.replace(/trcToken/,"uint256")),B.push(w),b.push(T)}try{h=A.encode(B,b).replace(/^(0x)/,"")}catch(t){return r(t)}}else h=""}var F={owner_address:eo(e),fee_limit:parseInt(o),call_value:parseInt(a),consume_user_resource_percent:n,origin_energy_limit:s,abi:JSON.stringify(l),bytecode:d,parameter:h,name:y};Sr.isNotNullOrUndefined(i)&&(F.call_token_value=parseInt(i)),Sr.isNotNullOrUndefined(c)&&(F.token_id=parseInt(c)),t&&t.permissionId&&(F.Permission_id=t.permissionId),this.tronWeb.fullNode.request("wallet/deploycontract",F,"post").then((function(e){return oo(e,F,t,r)})).catch((function(t){return r(t)}))}}},{key:"triggerSmartContract",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return"object"!==f()(e[2])&&(e[2]={feeLimit:e[2],callValue:e[3]},e.splice(3,1)),this._triggerSmartContract.apply(this,e)}},{key:"triggerConstantContract",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e[2]._isConstant=!0,this.triggerSmartContract.apply(this,e)}},{key:"triggerConfirmedConstantContract",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e[2]._isConstant=!0,e[2].confirmed=!0,this.triggerSmartContract.apply(this,e)}},{key:"estimateEnergy",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e[2].estimateEnergy=!0,this.triggerSmartContract.apply(this,e)}},{key:"_triggerSmartContract",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Sr.isFunction(n)&&(s=n,n=this.tronWeb.defaultAddress.hex),Sr.isFunction(o)&&(s=o,o=[]),!s)return this.injectPromise(this._triggerSmartContract,t,e,r,o,n);var a=Object.assign({callValue:0,feeLimit:this.tronWeb.feeLimit},r),i=a.tokenValue,c=a.tokenId,p=a.callValue,l=a.feeLimit;if(!this.validator.notValid([{name:"feeLimit",type:"integer",value:l,gt:0},{name:"callValue",type:"integer",value:p,gte:0},{name:"parameters",type:"array",value:o},{name:"contract",type:"address",value:t},{name:"issuer",type:"address",value:n,optional:!0},{name:"tokenValue",type:"integer",value:i,gte:0,optional:!0},{name:"tokenId",type:"integer",value:c,gte:0,optional:!0}],s)){var u={contract_address:eo(t),owner_address:eo(n)};if(e&&Sr.isString(e)){if(e=e.replace("/s*/g",""),o.length){for(var d=new dt,g=[],h=[],f=0;f<o.length;f++){var y=o[f],v=y.type,m=y.value;if(!v||!Sr.isString(v)||!v.length)return s("Invalid parameter type provided: "+v);"address"===v?m=eo(m).replace(V,"0x"):"address["===v.match(/^([^\x5b]*)(\x5b|$)/)[0]&&(m=m.map((function(t){return eo(t).replace(V,"0x")}))),g.push(v),h.push(m)}try{g=g.map((function(t){return/trcToken/.test(t)&&(t=t.replace(/trcToken/,"uint256")),t})),o=d.encode(g,h).replace(/^(0x)/,"")}catch(t){return s(t)}}else o="";r.funcABIV2&&(o=Ae(r.funcABIV2,r.parametersV2).replace(/^(0x)/,"")),r.shieldedParameter&&Sr.isString(r.shieldedParameter)&&(o=r.shieldedParameter.replace(/^(0x)/,"")),r.rawParameter&&Sr.isString(r.rawParameter)&&(o=r.rawParameter.replace(/^(0x)/,"")),u.function_selector=e,u.parameter=o}u.call_value=parseInt(p),Sr.isNotNullOrUndefined(i)&&(u.call_token_value=parseInt(i)),Sr.isNotNullOrUndefined(c)&&(u.token_id=parseInt(c)),r._isConstant||r.estimateEnergy||(u.fee_limit=parseInt(l)),r.permissionId&&(u.Permission_id=r.permissionId);var A="triggersmartcontract";r._isConstant?A="triggerconstantcontract":r.estimateEnergy&&(A="estimateenergy"),A="wallet".concat(r.confirmed?"solidity":"","/").concat(A),this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request(A,u,"post").then((function(t){return no(t,u,r,s)})).catch((function(t){return s(t)}))}}},{key:"clearABI",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this.clearABI,t,e);if(!this.tronWeb.isAddress(t))return r("Invalid contract address provided");if(!this.tronWeb.isAddress(e))return r("Invalid owner address provided");var o={contract_address:eo(t),owner_address:eo(e)};this.tronWeb.trx.cache.contracts[t]&&delete this.tronWeb.trx.cache.contracts[t],this.tronWeb.fullNode.request("wallet/clearabi",o,"post").then((function(t){return oo(t,o,{},r)})).catch((function(t){return r(t)}))}},{key:"updateBrokerage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this.updateBrokerage,t,e);if(!Sr.isNotNullOrUndefined(t))return r("Invalid brokerage provided");if(!Sr.isInteger(t)||t<0||t>100)return r("Brokerage must be an integer between 0 and 100");if(!this.tronWeb.isAddress(e))return r("Invalid owner address provided");var o={brokerage:parseInt(t),owner_address:eo(e)},n={};this.tronWeb.fullNode.request("wallet/updateBrokerage",o,"post").then((function(t){return oo(t,o,n,r)})).catch((function(t){return r(t)}))}},{key:"createToken",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.createToken,t,e);var o=t.name,n=void 0!==o&&o,s=t.abbreviation,a=void 0!==s&&s,i=t.description,c=void 0!==i&&i,p=t.url,l=void 0!==p&&p,u=t.totalSupply,d=void 0===u?0:u,g=t.trxRatio,h=void 0===g?1:g,f=t.tokenRatio,y=void 0===f?1:f,v=t.saleStart,m=void 0===v?Date.now():v,A=t.saleEnd,B=void 0!==A&&A,b=t.freeBandwidth,C=void 0===b?0:b,w=t.freeBandwidthLimit,T=void 0===w?0:w,F=t.frozenAmount,I=void 0===F?0:F,M=t.frozenDuration,k=void 0===M?0:M,W=t.voteScore,O=t.precision;if(!this.validator.notValid([{name:"Supply amount",type:"positive-integer",value:d},{name:"TRX ratio",type:"positive-integer",value:h},{name:"Token ratio",type:"positive-integer",value:y},{name:"token abbreviation",type:"not-empty-string",value:a},{name:"token name",type:"not-empty-string",value:n},{name:"token description",type:"not-empty-string",value:c},{name:"token url",type:"url",value:l},{name:"issuer",type:"address",value:e},{name:"sale start timestamp",type:"integer",value:m,gte:Date.now()},{name:"sale end timestamp",type:"integer",value:B,gt:m},{name:"Free bandwidth amount",type:"integer",value:C,gte:0},{name:"Free bandwidth limit",type:"integer",value:T,gte:0},{name:"Frozen supply",type:"integer",value:I,gte:0},{name:"Frozen duration",type:"integer",value:k,gte:0}],r)){if(Sr.isNotNullOrUndefined(W)&&(!Sr.isInteger(W)||W<=0))return r("voteScore must be a positive integer greater than 0");if(Sr.isNotNullOrUndefined(O)&&(!Sr.isInteger(O)||O<0||O>6))return r("precision must be a positive integer >= 0 and <= 6");var E={owner_address:eo(e),name:ro(n),abbr:ro(a),description:ro(c),url:ro(l),total_supply:parseInt(d),trx_num:parseInt(h),num:parseInt(y),start_time:parseInt(m),end_time:parseInt(B),free_asset_net_limit:parseInt(C),public_free_asset_net_limit:parseInt(T),frozen_supply:{frozen_amount:parseInt(I),frozen_days:parseInt(k)}};parseInt(I)>0||delete E.frozen_supply,O&&!isNaN(parseInt(O))&&(E.precision=parseInt(O)),W&&!isNaN(parseInt(W))&&(E.vote_score=parseInt(W)),t&&t.permissionId&&(E.Permission_id=t.permissionId),this.tronWeb.fullNode.request("wallet/createassetissue",E,"post").then((function(t){return oo(t,E,r)})).catch((function(t){return r(t)}))}}},{key:"createAccount",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Sr.isFunction(r)&&(o=r,r={}),Sr.isFunction(e)?(o=e,e=this.tronWeb.defaultAddress.hex):Sr.isObject(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.createAccount,t,e,r);if(!this.validator.notValid([{name:"account",type:"address",value:t},{name:"origin",type:"address",value:e}],o)){var n={owner_address:eo(e),account_address:eo(t)};r&&r.permissionId&&(n.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/createaccount",n,"post").then((function(t){return oo(t,n,r,o)})).catch((function(t){return o(t)}))}}},{key:"updateAccount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Sr.isFunction(r)&&(o=r,r={}),Sr.isFunction(e)?(o=e,e=this.tronWeb.defaultAddress.hex):Sr.isObject(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.updateAccount,t,e,r);if(!this.validator.notValid([{name:"Name",type:"not-empty-string",value:t},{name:"origin",type:"address",value:e}],o)){var n={account_name:ro(t),owner_address:eo(e)};r&&r.permissionId&&(n.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/updateaccount",n,"post").then((function(t){return oo(t,n,r,o)})).catch((function(t){return o(t)}))}}},{key:"setAccountId",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.setAccountId,t,e);if(t&&Sr.isString(t)&&t.startsWith("0x")&&(t=t.slice(2)),!this.validator.notValid([{name:"accountId",type:"hex",value:t},{name:"accountId",type:"string",lte:32,gte:8,value:t},{name:"origin",type:"address",value:e}],r)){var o={account_id:t,owner_address:eo(e)};this.tronWeb.fullNode.request("wallet/setaccountid",o,"post").then((function(t){return oo(t,o,{},r)})).catch((function(t){return r(t)}))}}},{key:"updateToken",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)?(r=e,e=this.tronWeb.defaultAddress.hex):Sr.isObject(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.updateToken,t,e);var o=t,n=o.description,s=void 0!==n&&n,a=o.url,i=void 0!==a&&a,c=o.freeBandwidth,p=void 0===c?0:c,l=o.freeBandwidthLimit,u=void 0===l?0:l;if(!this.validator.notValid([{name:"token description",type:"not-empty-string",value:s},{name:"token url",type:"url",value:i},{name:"issuer",type:"address",value:e},{name:"Free bandwidth amount",type:"positive-integer",value:p},{name:"Free bandwidth limit",type:"positive-integer",value:u}],r)){var d={owner_address:eo(e),description:ro(s),url:ro(i),new_limit:parseInt(p),new_public_limit:parseInt(u)};t&&t.permissionId&&(d.Permission_id=t.permissionId),this.tronWeb.fullNode.request("wallet/updateasset",d,"post").then((function(e){return oo(e,d,t,r)})).catch((function(t){return r(t)}))}}},{key:"sendAsset",value:function(){return this.sendToken.apply(this,arguments)}},{key:"purchaseAsset",value:function(){return this.purchaseToken.apply(this,arguments)}},{key:"createAsset",value:function(){return this.createToken.apply(this,arguments)}},{key:"updateAsset",value:function(){return this.updateToken.apply(this,arguments)}},{key:"createProposal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Sr.isFunction(r)&&(o=r,r={}),Sr.isFunction(e)?(o=e,e=this.tronWeb.defaultAddress.hex):Sr.isObject(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.createProposal,t,e,r);if(!this.validator.notValid([{name:"issuer",type:"address",value:e}],o)){var n="Invalid proposal parameters provided";if(!t)return o(n);Sr.isArray(t)||(t=[t]);var s,a=Xr(t);try{for(a.s();!(s=a.n()).done;){var i=s.value;if(!Sr.isObject(i))return o(n)}}catch(t){a.e(t)}finally{a.f()}var c={owner_address:eo(e),parameters:t};r&&r.permissionId&&(c.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/proposalcreate",c,"post").then((function(t){return oo(t,c,r,o)})).catch((function(t){return o(t)}))}}},{key:"deleteProposal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Sr.isFunction(r)&&(o=r,r={}),Sr.isFunction(e)?(o=e,e=this.tronWeb.defaultAddress.hex):Sr.isObject(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.deleteProposal,t,e,r);if(!this.validator.notValid([{name:"issuer",type:"address",value:e},{name:"proposalID",type:"integer",value:t,gte:0}],o)){var n={owner_address:eo(e),proposal_id:parseInt(t)};r&&r.permissionId&&(n.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/proposaldelete",n,"post").then((function(t){return oo(t,n,r,o)})).catch((function(t){return o(t)}))}}},{key:"voteProposal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)?(n=r,r=this.tronWeb.defaultAddress.hex):Sr.isObject(r)&&(o=r,r=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.voteProposal,t,e,r,o);if(!this.validator.notValid([{name:"voter",type:"address",value:r},{name:"proposalID",type:"integer",value:t,gte:0},{name:"has approval",type:"boolean",value:e}],n)){var s={owner_address:eo(r),proposal_id:parseInt(t),is_add_approval:e};o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/proposalapprove",s,"post").then((function(t){return oo(t,s,o,n)})).catch((function(t){return n(t)}))}}},{key:"createTRXExchange",value:function(t,e,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,n=arguments.length>4?arguments[4]:void 0,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Sr.isFunction(n)&&(s=n,n={}),Sr.isFunction(o)?(s=o,o=this.tronWeb.defaultAddress.hex):Sr.isObject(o)&&(n=o,o=this.tronWeb.defaultAddress.hex),!s)return this.injectPromise(this.createTRXExchange,t,e,r,o,n);if(!this.validator.notValid([{name:"owner",type:"address",value:o},{name:"token name",type:"not-empty-string",value:t},{name:"token balance",type:"positive-integer",value:e},{name:"trx balance",type:"positive-integer",value:r}],s)){var a={owner_address:eo(o),first_token_id:ro(t),first_token_balance:e,second_token_id:"5f",second_token_balance:r};n&&n.permissionId&&(a.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/exchangecreate",a,"post").then((function(t){return oo(t,a,n,s)})).catch((function(t){return s(t)}))}}},{key:"createTokenExchange",value:function(t,e,r,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Sr.isFunction(s)&&(a=s,s={}),Sr.isFunction(n)?(a=n,n=this.tronWeb.defaultAddress.hex):Sr.isObject(n)&&(s=n,n=this.tronWeb.defaultAddress.hex),!a)return this.injectPromise(this.createTokenExchange,t,e,r,o,n,s);if(!this.validator.notValid([{name:"owner",type:"address",value:n},{name:"first token name",type:"not-empty-string",value:t},{name:"second token name",type:"not-empty-string",value:r},{name:"first token balance",type:"positive-integer",value:e},{name:"second token balance",type:"positive-integer",value:o}],a)){var i={owner_address:eo(n),first_token_id:ro(t),first_token_balance:e,second_token_id:ro(r),second_token_balance:o};s&&s.permissionId&&(i.Permission_id=s.permissionId),this.tronWeb.fullNode.request("wallet/exchangecreate",i,"post").then((function(t){return oo(t,i,s,a)})).catch((function(t){return a(t)}))}}},{key:"injectExchangeTokens",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,n=arguments.length>4?arguments[4]:void 0,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Sr.isFunction(n)&&(s=n,n={}),Sr.isFunction(o)?(s=o,o=this.tronWeb.defaultAddress.hex):Sr.isObject(o)&&(n=o,o=this.tronWeb.defaultAddress.hex),!s)return this.injectPromise(this.injectExchangeTokens,t,e,r,o,n);if(!this.validator.notValid([{name:"owner",type:"address",value:o},{name:"token name",type:"not-empty-string",value:e},{name:"token amount",type:"integer",value:r,gte:1},{name:"exchangeID",type:"integer",value:t,gte:0}],s)){var a={owner_address:eo(o),exchange_id:parseInt(t),token_id:ro(e),quant:parseInt(r)};n&&n.permissionId&&(a.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/exchangeinject",a,"post").then((function(t){return oo(t,a,n,s)})).catch((function(t){return s(t)}))}}},{key:"withdrawExchangeTokens",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,n=arguments.length>4?arguments[4]:void 0,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Sr.isFunction(n)&&(s=n,n={}),Sr.isFunction(o)?(s=o,o=this.tronWeb.defaultAddress.hex):Sr.isObject(o)&&(n=o,o=this.tronWeb.defaultAddress.hex),!s)return this.injectPromise(this.withdrawExchangeTokens,t,e,r,o,n);if(!this.validator.notValid([{name:"owner",type:"address",value:o},{name:"token name",type:"not-empty-string",value:e},{name:"token amount",type:"integer",value:r,gte:1},{name:"exchangeID",type:"integer",value:t,gte:0}],s)){var a={owner_address:eo(o),exchange_id:parseInt(t),token_id:ro(e),quant:parseInt(r)};n&&n.permissionId&&(a.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/exchangewithdraw",a,"post").then((function(t){return oo(t,a,n,s)})).catch((function(t){return s(t)}))}}},{key:"tradeExchangeTokens",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Sr.isFunction(s)&&(a=s,s={}),Sr.isFunction(n)?(a=n,n=this.tronWeb.defaultAddress.hex):Sr.isObject(n)&&(s=n,n=this.tronWeb.defaultAddress.hex),!a)return this.injectPromise(this.tradeExchangeTokens,t,e,r,o,n,s);if(!this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:e},{name:"tokenAmountSold",type:"integer",value:r,gte:1},{name:"tokenAmountExpected",type:"integer",value:o,gte:1},{name:"exchangeID",type:"integer",value:t,gte:0}],a)){var i={owner_address:eo(n),exchange_id:parseInt(t),token_id:this.tronWeb.fromAscii(e),quant:parseInt(r),expected:parseInt(o)};s&&s.permissionId&&(i.Permission_id=s.permissionId),this.tronWeb.fullNode.request("wallet/exchangetransaction",i,"post").then((function(t){return oo(t,i,s,a)})).catch((function(t){return a(t)}))}}},{key:"updateSetting",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)?(n=r,r=this.tronWeb.defaultAddress.hex):Sr.isObject(r)&&(o=r,r=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.updateSetting,t,e,r,o);if(!this.validator.notValid([{name:"owner",type:"address",value:r},{name:"contract",type:"address",value:t},{name:"userFeePercentage",type:"integer",value:e,gte:0,lte:100}],n)){var s={owner_address:eo(r),contract_address:eo(t),consume_user_resource_percent:e};o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/updatesetting",s,"post").then((function(t){return oo(t,s,o,n)})).catch((function(t){return n(t)}))}}},{key:"updateEnergyLimit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,o=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)?(n=r,r=this.tronWeb.defaultAddress.hex):Sr.isObject(r)&&(o=r,r=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.updateEnergyLimit,t,e,r,o);if(!this.validator.notValid([{name:"owner",type:"address",value:r},{name:"contract",type:"address",value:t},{name:"originEnergyLimit",type:"integer",value:e,gte:0,lte:1e7}],n)){var s={owner_address:eo(r),contract_address:eo(t),origin_energy_limit:e};o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/updateenergylimit",s,"post").then((function(t){return oo(t,s,o,n)})).catch((function(t){return n(t)}))}}},{key:"checkPermissions",value:function(t,e){if(t){if(t.type!==e||!t.permission_name||!Sr.isString(t.permission_name)||!Sr.isInteger(t.threshold)||t.threshold<1||!t.keys)return!1;var r,o=Xr(t.keys);try{for(o.s();!(r=o.n()).done;){var n=r.value;if(!this.tronWeb.isAddress(n.address)||!Sr.isInteger(n.weight)||n.weight>t.threshold||n.weight<1||2===e&&!t.operations)return!1}}catch(t){o.e(t)}finally{o.f()}}return!0}},{key:"updateAccountPermissions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(o)&&(n=o,o=!1),Sr.isFunction(r)&&(n=r,r=o=!1),Sr.isFunction(e)&&(n=e,e=r=o=!1),!n)return this.injectPromise(this.updateAccountPermissions,t,e,r,o);if(!this.tronWeb.isAddress(t))return n("Invalid ownerAddress provided");if(!this.checkPermissions(e,0))return n("Invalid ownerPermissions provided");if(!this.checkPermissions(r,1))return n("Invalid witnessPermissions provided");Array.isArray(o)||(o=[o]);var s,a=Xr(o);try{for(a.s();!(s=a.n()).done;){var i=s.value;if(!this.checkPermissions(i,2))return n("Invalid activesPermissions provided")}}catch(t){a.e(t)}finally{a.f()}var c={owner_address:t};e&&(c.owner=e),r&&(c.witness=r),o&&(c.actives=1===o.length?o[0]:o),this.tronWeb.fullNode.request("wallet/accountpermissionupdate",c,"post").then((function(t){return oo(t,c,{},n)})).catch((function(t){return n(t)}))}},{key:"newTxID",value:(n=g()(E.a.mark((function t(e,r){return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return",this.injectPromise(this.newTxID,e));case 2:this.tronWeb.fullNode.request("wallet/getsignweight",e,"post").then((function(t){return"boolean"==typeof e.visible&&(t.transaction.transaction.visible=e.visible),oo(t.transaction.transaction,Zr(Zr({},e.raw_data.contract[0].parameter.value),{},{Permission_id:e.raw_data.contract[0].Permission_id}),{data:e.raw_data.data,fee_limit:e.raw_data.fee_limit},r)})).catch((function(t){return r("Error generating a new transaction id.")}));case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"alterTransaction",value:(o=g()(E.a.mark((function t(e){var r,o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.length>1&&void 0!==n[1]?n[1]:{},o=n.length>2&&void 0!==n[2]&&n[2]){t.next=4;break}return t.abrupt("return",this.injectPromise(this.alterTransaction,e,r));case 4:if(!e.signature){t.next=6;break}return t.abrupt("return",o("You can not extend the expiration of a signed transaction."));case 6:if(!r.data){t.next=12;break}if("hex"!==r.dataFormat&&(r.data=this.tronWeb.toHex(r.data)),r.data=r.data.replace(/^0x/,""),0!==r.data.length){t.next=11;break}return t.abrupt("return",o("Invalid data provided"));case 11:e.raw_data.data=r.data;case 12:if(!r.extension){t.next=17;break}if(r.extension=parseInt(1e3*r.extension),!(isNaN(r.extension)||e.raw_data.expiration+r.extension<=Date.now()+3e3)){t.next=16;break}return t.abrupt("return",o("Invalid extension provided"));case 16:e.raw_data.expiration+=r.extension;case 17:this.newTxID(e,o);case 18:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"extendExpiration",value:(r=g()(E.a.mark((function t(e,r){var o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n.length>2&&void 0!==n[2]&&n[2]){t.next=3;break}return t.abrupt("return",this.injectPromise(this.extendExpiration,e,r));case 3:this.alterTransaction(e,{extension:r},o);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"addUpdateData",value:(e=g()(E.a.mark((function t(e,r){var o,n,s=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=s.length>2&&void 0!==s[2]?s[2]:"utf8",n=s.length>3&&void 0!==s[3]&&s[3],Sr.isFunction(o)&&(n=o,o="utf8"),n){t.next=5;break}return t.abrupt("return",this.injectPromise(this.addUpdateData,e,r,o));case 5:this.alterTransaction(e,{data:r,dataFormat:o},n);case 6:case"end":return t.stop()}}),t,this)}))),function(t,r){return e.apply(this,arguments)})}]),t}();function ao(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function io(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ao(Object(r),!0).forEach((function(e){W()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ao(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function co(t){return To.address.toHex(t)}var po=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v()(this,t),!e||!e instanceof To)throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.injectPromise=Gr()(this),this.cache={contracts:{}},this.validator=new Yr(e)}var e,r,o,n,s,a,i,c,p,l,u,d,h,f,y,m,B;return A()(t,[{key:"_parseToken",value:function(t){return io(io({},t),{},{name:this.tronWeb.toUtf8(t.name),abbr:t.abbr&&this.tronWeb.toUtf8(t.abbr),description:t.description&&this.tronWeb.toUtf8(t.description),url:t.url&&this.tronWeb.toUtf8(t.url)})}},{key:"getCurrentBlock",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.getCurrentBlock);this.tronWeb.fullNode.request("wallet/getnowblock").then((function(e){t(null,e)})).catch((function(e){return t(e)}))}},{key:"getConfirmedCurrentBlock",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.getConfirmedCurrentBlock);this.tronWeb.solidityNode.request("walletsolidity/getnowblock").then((function(e){t(null,e)})).catch((function(e){return t(e)}))}},{key:"getBlock",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Sr.isFunction(t)&&(e=t,t=this.tronWeb.defaultBlock),e?!1===t?e("No block identifier provided"):("earliest"==t&&(t=0),"latest"==t?this.getCurrentBlock(e):isNaN(t)&&Sr.isHex(t)?this.getBlockByHash(t,e):void this.getBlockByNumber(t,e)):this.injectPromise(this.getBlock,t)}},{key:"getBlockByHash",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return this.injectPromise(this.getBlockByHash,t);this.tronWeb.fullNode.request("wallet/getblockbyid",{value:t},"post").then((function(t){if(!Object.keys(t).length)return e("Block not found");e(null,t)})).catch((function(t){return e(t)}))}},{key:"getBlockByNumber",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?!Sr.isInteger(t)||t<0?e("Invalid block number provided"):void this.tronWeb.fullNode.request("wallet/getblockbynum",{num:parseInt(t)},"post").then((function(t){if(!Object.keys(t).length)return e("Block not found");e(null,t)})).catch((function(t){return e(t)})):this.injectPromise(this.getBlockByNumber,t)}},{key:"getBlockTransactionCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Sr.isFunction(t)&&(e=t,t=this.tronWeb.defaultBlock),!e)return this.injectPromise(this.getBlockTransactionCount,t);this.getBlock(t).then((function(t){var r=t.transactions;e(null,(void 0===r?[]:r).length)})).catch((function(t){return e(t)}))}},{key:"getTransactionFromBlock",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)&&(r=e,e=0),Sr.isFunction(t)&&(r=t,t=this.tronWeb.defaultBlock),!r)return this.injectPromise(this.getTransactionFromBlock,t,e);this.getBlock(t).then((function(t){var o=t.transactions,n=void 0!==o&&o;n?"number"==typeof e?e>=0&&e<n.length?r(null,n[e]):r("Invalid transaction index provided"):r(null,n):r("Transaction not found in block")})).catch((function(t){return r(t)}))}},{key:"getTransaction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return this.injectPromise(this.getTransaction,t);this.tronWeb.fullNode.request("wallet/gettransactionbyid",{value:t},"post").then((function(t){if(!Object.keys(t).length)return e("Transaction not found");e(null,t)})).catch((function(t){return e(t)}))}},{key:"getConfirmedTransaction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return this.injectPromise(this.getConfirmedTransaction,t);this.tronWeb.solidityNode.request("walletsolidity/gettransactionbyid",{value:t},"post").then((function(t){if(!Object.keys(t).length)return e("Transaction not found");e(null,t)})).catch((function(t){return e(t)}))}},{key:"getUnconfirmedTransactionInfo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._getTransactionInfoById(t,{confirmed:!1},e)}},{key:"getTransactionInfo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._getTransactionInfoById(t,{confirmed:!0},e)}},{key:"_getTransactionInfoById",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this._getTransactionInfoById,t,e);this.tronWeb[e.confirmed?"solidityNode":"fullNode"].request("wallet".concat(e.confirmed?"solidity":"","/gettransactioninfobyid"),{value:t},"post").then((function(t){r(null,t)})).catch((function(t){return r(t)}))}},{key:"getTransactionsToAddress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Sr.isFunction(r)&&(o=r,r=0),Sr.isFunction(e)&&(o=e,e=30),o?(t=this.tronWeb.address.toHex(t),this.getTransactionsRelated(t,"to",e,r,o)):this.injectPromise(this.getTransactionsToAddress,t,e,r)}},{key:"getTransactionsFromAddress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Sr.isFunction(r)&&(o=r,r=0),Sr.isFunction(e)&&(o=e,e=30),o?(t=this.tronWeb.address.toHex(t),this.getTransactionsRelated(t,"from",e,r,o)):this.injectPromise(this.getTransactionsFromAddress,t,e,r)}},{key:"getTransactionsRelated",value:(B=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c,p,l=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]?l[0]:this.tronWeb.defaultAddress.hex,r=l.length>1&&void 0!==l[1]?l[1]:"all",o=l.length>2&&void 0!==l[2]?l[2]:30,n=l.length>3&&void 0!==l[3]?l[3]:0,s=l.length>4&&void 0!==l[4]&&l[4],Sr.isFunction(n)&&(s=n,n=0),Sr.isFunction(o)&&(s=o,o=30),Sr.isFunction(r)&&(s=r,r="all"),Sr.isFunction(e)&&(s=e,e=this.tronWeb.defaultAddress.hex),s){t.next=11;break}return t.abrupt("return",this.injectPromise(this.getTransactionsRelated,e,r,o,n));case 11:if(["to","from","all"].includes(r)){t.next=13;break}return t.abrupt("return",s('Invalid direction provided: Expected "to", "from" or "all"'));case 13:if("all"!=r){t.next=27;break}return t.prev=14,t.next=17,Promise.all([this.getTransactionsRelated(e,"from",o,n),this.getTransactionsRelated(e,"to",o,n)]);case 17:return a=t.sent,i=Hr()(a,2),c=i[0],p=i[1],t.abrupt("return",s(null,[].concat(L()(c.map((function(t){return t.direction="from",t}))),L()(p.map((function(t){return t.direction="to",t})))).sort((function(t,e){return e.raw_data.timestamp-t.raw_data.timestamp}))));case 24:return t.prev=24,t.t0=t.catch(14),t.abrupt("return",s(t.t0));case 27:if(this.tronWeb.isAddress(e)){t.next=29;break}return t.abrupt("return",s("Invalid address provided"));case 29:if(!(!Sr.isInteger(o)||o<0||n&&o<1)){t.next=31;break}return t.abrupt("return",s("Invalid limit provided"));case 31:if(Sr.isInteger(n)&&!(n<0)){t.next=33;break}return t.abrupt("return",s("Invalid offset provided"));case 33:e=this.tronWeb.address.toHex(e),this.tronWeb.solidityNode.request("walletextension/gettransactions".concat(r,"this"),{account:{address:e},offset:n,limit:o},"post").then((function(t){var e=t.transaction;s(null,e)})).catch((function(t){return s(t)}));case 35:case"end":return t.stop()}}),t,this,[[14,24]])}))),function(){return B.apply(this,arguments)})},{key:"getAccount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Sr.isFunction(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),e?this.tronWeb.isAddress(t)?(t=this.tronWeb.address.toHex(t),void this.tronWeb.solidityNode.request("walletsolidity/getaccount",{address:t},"post").then((function(t){e(null,t)})).catch((function(t){return e(t)}))):e("Invalid address provided"):this.injectPromise(this.getAccount,t)}},{key:"getAccountById",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return this.injectPromise(this.getAccountById,t);this.getAccountInfoById(t,{confirmed:!0},e)}},{key:"getAccountInfoById",value:function(t,e,r){this.validator.notValid([{name:"accountId",type:"hex",value:t},{name:"accountId",type:"string",lte:32,gte:8,value:t}],r)||(t.startsWith("0x")&&(t=t.slice(2)),this.tronWeb[e.confirmed?"solidityNode":"fullNode"].request("wallet".concat(e.confirmed?"solidity":"","/getaccountbyid"),{account_id:t},"post").then((function(t){r(null,t)})).catch((function(t){return r(t)})))}},{key:"getBalance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Sr.isFunction(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),!e)return this.injectPromise(this.getBalance,t);this.getAccount(t).then((function(t){var r=t.balance;e(null,void 0===r?0:r)})).catch((function(t){return e(t)}))}},{key:"getUnconfirmedAccount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Sr.isFunction(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),e?this.tronWeb.isAddress(t)?(t=this.tronWeb.address.toHex(t),void this.tronWeb.fullNode.request("wallet/getaccount",{address:t},"post").then((function(t){e(null,t)})).catch((function(t){return e(t)}))):e("Invalid address provided"):this.injectPromise(this.getUnconfirmedAccount,t)}},{key:"getUnconfirmedAccountById",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return this.injectPromise(this.getUnconfirmedAccountById,t);this.getAccountInfoById(t,{confirmed:!1},e)}},{key:"getUnconfirmedBalance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Sr.isFunction(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),!e)return this.injectPromise(this.getUnconfirmedBalance,t);this.getUnconfirmedAccount(t).then((function(t){var r=t.balance;e(null,void 0===r?0:r)})).catch((function(t){return e(t)}))}},{key:"getBandwidth",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Sr.isFunction(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),e?this.tronWeb.isAddress(t)?(t=this.tronWeb.address.toHex(t),void this.tronWeb.fullNode.request("wallet/getaccountnet",{address:t},"post").then((function(t){var r=t.freeNetUsed,o=void 0===r?0:r,n=t.freeNetLimit,s=void 0===n?0:n,a=t.NetUsed,i=void 0===a?0:a,c=t.NetLimit;e(null,s-o+((void 0===c?0:c)-i))})).catch((function(t){return e(t)}))):e("Invalid address provided"):this.injectPromise(this.getBandwidth,t)}},{key:"getTokensIssuedByAddress",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Sr.isFunction(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),r?this.tronWeb.isAddress(e)?(e=this.tronWeb.address.toHex(e),void this.tronWeb.fullNode.request("wallet/getassetissuebyaccount",{address:e},"post").then((function(e){var o=e.assetIssue,n=void 0!==o&&o;if(!n)return r(null,{});var s=n.map((function(e){return t._parseToken(e)})).reduce((function(t,e){return t[e.name]=e,t}),{});r(null,s)})).catch((function(t){return r(t)}))):r("Invalid address provided"):this.injectPromise(this.getTokensIssuedByAddress,e)}},{key:"getTokenFromID",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Sr.isInteger(e)&&(e=e.toString()),Sr.isString(e)&&e.length?void this.tronWeb.fullNode.request("wallet/getassetissuebyname",{value:this.tronWeb.fromUtf8(e)},"post").then((function(e){if(!e.name)return r("Token does not exist");r(null,t._parseToken(e))})).catch((function(t){return r(t)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenFromID,e)}},{key:"listNodes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.listNodes);this.tronWeb.fullNode.request("wallet/listnodes").then((function(r){var o=r.nodes;e(null,(void 0===o?[]:o).map((function(e){var r=e.address,o=r.host,n=r.port;return"".concat(t.tronWeb.toUtf8(o),":").concat(n)})))})).catch((function(t){return e(t)}))}},{key:"getBlockRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sr.isFunction(e)&&(r=e,e=30),Sr.isFunction(t)&&(r=t,t=0),r?!Sr.isInteger(t)||t<0?r("Invalid start of range provided"):!Sr.isInteger(e)||e<=t?r("Invalid end of range provided"):void this.tronWeb.fullNode.request("wallet/getblockbylimitnext",{startNum:parseInt(t),endNum:parseInt(e)+1},"post").then((function(t){var e=t.block;r(null,void 0===e?[]:e)})).catch((function(t){return r(t)})):this.injectPromise(this.getBlockRange,t,e)}},{key:"listSuperRepresentatives",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.listSuperRepresentatives);this.tronWeb.fullNode.request("wallet/listwitnesses").then((function(e){var r=e.witnesses;t(null,void 0===r?[]:r)})).catch((function(e){return t(e)}))}},{key:"listTokens",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sr.isFunction(r)&&(o=r,r=0),Sr.isFunction(e)&&(o=e,e=0),o?!Sr.isInteger(e)||e<0||r&&e<1?o("Invalid limit provided"):!Sr.isInteger(r)||r<0?o("Invalid offset provided"):e?void this.tronWeb.fullNode.request("wallet/getpaginatedassetissuelist",{offset:parseInt(r),limit:parseInt(e)},"post").then((function(e){var r=e.assetIssue;o(null,(void 0===r?[]:r).map((function(e){return t._parseToken(e)})))})).catch((function(t){return o(t)})):this.tronWeb.fullNode.request("wallet/getassetissuelist").then((function(e){var r=e.assetIssue;o(null,(void 0===r?[]:r).map((function(e){return t._parseToken(e)})))})).catch((function(t){return o(t)})):this.injectPromise(this.listTokens,e,r)}},{key:"timeUntilNextVoteCycle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.timeUntilNextVoteCycle);this.tronWeb.fullNode.request("wallet/getnextmaintenancetime").then((function(e){var r=e.num,o=void 0===r?-1:r;if(-1==o)return t("Failed to get time until next vote cycle");t(null,Math.floor(o/1e3))})).catch((function(e){return t(e)}))}},{key:"getContract",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?this.tronWeb.isAddress(t)?void(this.cache.contracts[t]?r(null,this.cache.contracts[t]):(t=this.tronWeb.address.toHex(t),this.tronWeb.fullNode.request("wallet/getcontract",{value:t}).then((function(o){if(o.Error)return r("Contract does not exist");e.cache.contracts[t]=o,r(null,o)})).catch((function(t){return r(t)})))):r("Invalid contract address provided"):this.injectPromise(this.getContract,t)}},{key:"verifyMessage",value:(m=g()(E.a.mark((function e(){var r,o,n,s,a,i=arguments;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i.length>0&&void 0!==i[0]&&i[0],o=i.length>1&&void 0!==i[1]&&i[1],n=i.length>2&&void 0!==i[2]?i[2]:this.tronWeb.defaultAddress.base58,s=!(i.length>3&&void 0!==i[3])||i[3],a=i.length>4&&void 0!==i[4]&&i[4],Sr.isFunction(n)&&(a=n,n=this.tronWeb.defaultAddress.base58,s=!0),Sr.isFunction(s)&&(a=s,s=!0),a){e.next=9;break}return e.abrupt("return",this.injectPromise(this.verifyMessage,r,o,n,s));case 9:if(Sr.isHex(r)){e.next=11;break}return e.abrupt("return",a("Expected hex message input"));case 11:if(!t.verifySignature(r,n,o,s)){e.next=13;break}return e.abrupt("return",a(null,!0));case 13:a("Signature does not match");case 14:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"verifyMessageV2",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Sr.isFunction(o)&&(n=o,o={}),!n)return this.injectPromise(this.verifyMessageV2,e,r,o);try{var s=t.verifyMessageV2(e,r);n(null,s)}catch(t){n(t)}}},{key:"verifyTypedData",value:function(e,r,o,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.base58,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return Sr.isFunction(s)&&(a=s,s=this.tronWeb.defaultAddress.base58),a?t.verifyTypedData(e,r,o,n,s)?a(null,!0):void a("Signature does not match"):this.injectPromise(this.verifyTypedData,e,r,o,n,s)}},{key:"sign",value:(y=g()(E.a.mark((function e(){var r,o,n,s,a,i,c=arguments;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=c.length>0&&void 0!==c[0]&&c[0],o=c.length>1&&void 0!==c[1]?c[1]:this.tronWeb.defaultPrivateKey,n=!(c.length>2&&void 0!==c[2])||c[2],s=c.length>3&&void 0!==c[3]&&c[3],a=c.length>4&&void 0!==c[4]&&c[4],Sr.isFunction(s)&&(a=s,s=!1),Sr.isFunction(n)&&(a=n,n=!0,s=!1),Sr.isFunction(o)&&(a=o,o=this.tronWeb.defaultPrivateKey,n=!0,s=!1),a){e.next=10;break}return e.abrupt("return",this.injectPromise(this.sign,r,o,n,s));case 10:if(!Sr.isString(r)){e.next=21;break}if(Sr.isHex(r)){e.next=13;break}return e.abrupt("return",a("Expected hex message input"));case 13:return e.prev=13,i=t.signString(r,o,n),e.abrupt("return",a(null,i));case 18:e.prev=18,e.t0=e.catch(13),a(e.t0);case 21:if(Sr.isObject(r)){e.next=23;break}return e.abrupt("return",a("Invalid transaction provided"));case 23:if(s||!r.signature){e.next=25;break}return e.abrupt("return",a("Transaction is already signed"));case 25:if(e.prev=25,s){e.next=32;break}if(this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(o)).toLowerCase()===this.tronWeb.address.toHex(r.raw_data.contract[0].parameter.value.owner_address)){e.next=30;break}return e.abrupt("return",a("Private key does not match address in transaction"));case 30:if(Mr(r)){e.next=32;break}return e.abrupt("return",a("Invalid transaction"));case 32:return e.abrupt("return",a(null,Sr.crypto.signTransaction(o,r)));case 35:e.prev=35,e.t1=e.catch(25),a(e.t1);case 38:case"end":return e.stop()}}),e,this,[[13,18],[25,35]])}))),function(){return y.apply(this,arguments)})},{key:"signMessageV2",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultPrivateKey,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Sr.isFunction(o)&&(n=o,o={}),Sr.isFunction(r)&&(n=r,r=this.tronWeb.defaultPrivateKey),!n)return this.injectPromise(this.signMessageV2,e,r);try{var s=t.signMessageV2(e,r);return n(null,s)}catch(t){n(t)}}},{key:"_signTypedData",value:function(e,r,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultPrivateKey,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Sr.isFunction(n)&&(s=n,n=this.tronWeb.defaultPrivateKey),!s)return this.injectPromise(this._signTypedData,e,r,o,n);try{var a=t._signTypedData(e,r,o,n);return s(null,a)}catch(t){s(t)}}},{key:"multiSign",value:(f=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]&&c[0],r=c.length>1&&void 0!==c[1]?c[1]:this.tronWeb.defaultPrivateKey,o=c.length>2&&void 0!==c[2]&&c[2],n=c.length>3&&void 0!==c[3]&&c[3],Sr.isFunction(o)&&(n=o,o=0),Sr.isFunction(r)&&(n=r,r=this.tronWeb.defaultPrivateKey,o=0),n){t.next=8;break}return t.abrupt("return",this.injectPromise(this.multiSign,e,r,o));case 8:if(Sr.isObject(e)&&e.raw_data&&e.raw_data.contract){t.next=10;break}return t.abrupt("return",n("Invalid transaction provided"));case 10:if(e.raw_data.contract[0].Permission_id||!(o>0)){t.next=30;break}return e.raw_data.contract[0].Permission_id=o,s=this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(r)).toLowerCase(),t.next=15,this.getSignWeight(e,o);case 15:if("PERMISSION_ERROR"!==(a=t.sent).result.code){t.next=18;break}return t.abrupt("return",n(a.result.message));case 18:if(i=!1,a.permission.keys.map((function(t){t.address===s&&(i=!0)})),i){t.next=22;break}return t.abrupt("return",n(r+" has no permission to sign"));case 22:if(!a.approved_list||-1==a.approved_list.indexOf(s)){t.next=24;break}return t.abrupt("return",n(r+" already sign transaction"));case 24:if(!a.transaction||!a.transaction.transaction){t.next=29;break}e=a.transaction.transaction,o>0&&(e.raw_data.contract[0].Permission_id=o),t.next=30;break;case 29:return t.abrupt("return",n("Invalid transaction provided"));case 30:if(t.prev=30,Mr(e)){t.next=33;break}return t.abrupt("return",n("Invalid transaction"));case 33:return t.abrupt("return",n(null,Sr.crypto.signTransaction(r,e)));case 36:t.prev=36,t.t0=t.catch(30),n(t.t0);case 39:case"end":return t.stop()}}),t,this,[[30,36]])}))),function(){return f.apply(this,arguments)})},{key:"getApprovedList",value:(h=g()(E.a.mark((function t(e){var r,o=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1]){t.next=3;break}return t.abrupt("return",this.injectPromise(this.getApprovedList,e));case 3:if(Sr.isObject(e)){t.next=5;break}return t.abrupt("return",r("Invalid transaction provided"));case 5:this.tronWeb.fullNode.request("wallet/getapprovedlist",e,"post").then((function(t){r(null,t)})).catch((function(t){return r(t)}));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return h.apply(this,arguments)})},{key:"getSignWeight",value:(d=g()(E.a.mark((function t(e,r){var o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n.length>2&&void 0!==n[2]&&n[2],Sr.isFunction(r)&&(o=r,r=void 0),o){t.next=4;break}return t.abrupt("return",this.injectPromise(this.getSignWeight,e,r));case 4:if(Sr.isObject(e)&&e.raw_data&&e.raw_data.contract){t.next=6;break}return t.abrupt("return",o("Invalid transaction provided"));case 6:if(Sr.isInteger(r)?e.raw_data.contract[0].Permission_id=parseInt(r):"number"!=typeof e.raw_data.contract[0].Permission_id&&(e.raw_data.contract[0].Permission_id=0),Sr.isObject(e)){t.next=9;break}return t.abrupt("return",o("Invalid transaction provided"));case 9:this.tronWeb.fullNode.request("wallet/getsignweight",e,"post").then((function(t){o(null,t)})).catch((function(t){return o(t)}));case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return d.apply(this,arguments)})},{key:"sendRawTransaction",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sr.isFunction(e)&&(r=e,e={}),r?Sr.isObject(t)?Sr.isObject(e)?t.signature&&Sr.isArray(t.signature)?void this.tronWeb.fullNode.request("wallet/broadcasttransaction",t,"post").then((function(e){e.result&&(e.transaction=t),r(null,e)})).catch((function(t){return r(t)})):r("Transaction is not signed"):r("Invalid options provided"):r("Invalid transaction provided"):this.injectPromise(this.sendRawTransaction,t,e)}},{key:"sendHexTransaction",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)&&(r=e,e={}),!r)return this.injectPromise(this.sendHexTransaction,t,e);if(!Sr.isHex(t))return r("Invalid hex transaction provided");if(!Sr.isObject(e))return r("Invalid options provided");var o={transaction:t};this.tronWeb.fullNode.request("wallet/broadcasthex",o,"post").then((function(e){e.result&&(e.transaction=JSON.parse(e.transaction),e.hexTransaction=t),r(null,e)})).catch((function(t){return r(t)}))}},{key:"sendTransaction",value:(u=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],r=p.length>1&&void 0!==p[1]&&p[1],o=p.length>2&&void 0!==p[2]?p[2]:{},n=p.length>3&&void 0!==p[3]&&p[3],Sr.isFunction(o)&&(n=o,o={}),"string"==typeof o&&(o={privateKey:o}),n){t.next=8;break}return t.abrupt("return",this.injectPromise(this.sendTransaction,e,r,o));case 8:if(this.tronWeb.isAddress(e)){t.next=10;break}return t.abrupt("return",n("Invalid recipient provided"));case 10:if(Sr.isInteger(r)&&!(r<=0)){t.next=12;break}return t.abrupt("return",n("Invalid amount provided"));case 12:if((o=io({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},o)).privateKey||o.address){t.next=15;break}return t.abrupt("return",n("Function requires either a private key or address to be set"));case 15:return t.prev=15,s=o.privateKey?this.tronWeb.address.fromPrivateKey(o.privateKey):o.address,t.next=19,this.tronWeb.transactionBuilder.sendTrx(e,r,s);case 19:return a=t.sent,t.next=22,this.sign(a,o.privateKey||void 0);case 22:return i=t.sent,t.next=25,this.sendRawTransaction(i);case 25:return c=t.sent,t.abrupt("return",n(null,c));case 29:return t.prev=29,t.t0=t.catch(15),t.abrupt("return",n(t.t0));case 32:case"end":return t.stop()}}),t,this,[[15,29]])}))),function(){return u.apply(this,arguments)})},{key:"sendToken",value:(l=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c,p,l=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],r=l.length>1&&void 0!==l[1]&&l[1],o=l.length>2&&void 0!==l[2]&&l[2],n=l.length>3&&void 0!==l[3]?l[3]:{},s=l.length>4&&void 0!==l[4]&&l[4],Sr.isFunction(n)&&(s=n,n={}),"string"==typeof n&&(n={privateKey:n}),s){t.next=9;break}return t.abrupt("return",this.injectPromise(this.sendToken,e,r,o,n));case 9:if(this.tronWeb.isAddress(e)){t.next=11;break}return t.abrupt("return",s("Invalid recipient provided"));case 11:if(Sr.isInteger(r)&&!(r<=0)){t.next=13;break}return t.abrupt("return",s("Invalid amount provided"));case 13:if(Sr.isInteger(o)&&(o=o.toString()),Sr.isString(o)){t.next=16;break}return t.abrupt("return",s("Invalid token ID provided"));case 16:if((n=io({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},n)).privateKey||n.address){t.next=19;break}return t.abrupt("return",s("Function requires either a private key or address to be set"));case 19:return t.prev=19,a=n.privateKey?this.tronWeb.address.fromPrivateKey(n.privateKey):n.address,t.next=23,this.tronWeb.transactionBuilder.sendToken(e,r,o,a);case 23:return i=t.sent,t.next=26,this.sign(i,n.privateKey||void 0);case 26:return c=t.sent,t.next=29,this.sendRawTransaction(c);case 29:return p=t.sent,t.abrupt("return",s(null,p));case 33:return t.prev=33,t.t0=t.catch(19),t.abrupt("return",s(t.t0));case 36:case"end":return t.stop()}}),t,this,[[19,33]])}))),function(){return l.apply(this,arguments)})},{key:"freezeBalance",value:(p=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c,p,l,u=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:0,r=u.length>1&&void 0!==u[1]?u[1]:3,o=u.length>2&&void 0!==u[2]?u[2]:"BANDWIDTH",n=u.length>3&&void 0!==u[3]?u[3]:{},s=u.length>4&&void 0!==u[4]?u[4]:void 0,a=u.length>5&&void 0!==u[5]&&u[5],Sr.isFunction(s)&&(a=s,s=void 0),Sr.isFunction(r)&&(a=r,r=3),Sr.isFunction(o)&&(a=o,o="BANDWIDTH"),Sr.isFunction(n)&&(a=n,n={}),"string"==typeof n&&(n={privateKey:n}),a){t.next=13;break}return t.abrupt("return",this.injectPromise(this.freezeBalance,e,r,o,n,s));case 13:if(["BANDWIDTH","ENERGY"].includes(o)){t.next=15;break}return t.abrupt("return",a('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'));case 15:if(Sr.isInteger(e)&&!(e<=0)){t.next=17;break}return t.abrupt("return",a("Invalid amount provided"));case 17:if(Sr.isInteger(r)&&!(r<3)){t.next=19;break}return t.abrupt("return",a("Invalid duration provided, minimum of 3 days"));case 19:if((n=io({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},n)).privateKey||n.address){t.next=22;break}return t.abrupt("return",a("Function requires either a private key or address to be set"));case 22:return t.prev=22,i=n.privateKey?this.tronWeb.address.fromPrivateKey(n.privateKey):n.address,t.next=26,this.tronWeb.transactionBuilder.freezeBalance(e,r,o,i,s);case 26:return c=t.sent,t.next=29,this.sign(c,n.privateKey||void 0);case 29:return p=t.sent,t.next=32,this.sendRawTransaction(p);case 32:return l=t.sent,t.abrupt("return",a(null,l));case 36:return t.prev=36,t.t0=t.catch(22),t.abrupt("return",a(t.t0));case 39:case"end":return t.stop()}}),t,this,[[22,36]])}))),function(){return p.apply(this,arguments)})},{key:"unfreezeBalance",value:(c=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]?p[0]:"BANDWIDTH",r=p.length>1&&void 0!==p[1]?p[1]:{},o=p.length>2&&void 0!==p[2]?p[2]:void 0,n=p.length>3&&void 0!==p[3]&&p[3],Sr.isFunction(o)&&(n=o,o=void 0),Sr.isFunction(e)&&(n=e,e="BANDWIDTH"),Sr.isFunction(r)&&(n=r,r={}),"string"==typeof r&&(r={privateKey:r}),n){t.next=10;break}return t.abrupt("return",this.injectPromise(this.unfreezeBalance,e,r,o));case 10:if(["BANDWIDTH","ENERGY"].includes(e)){t.next=12;break}return t.abrupt("return",n('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'));case 12:if((r=io({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},r)).privateKey||r.address){t.next=15;break}return t.abrupt("return",n("Function requires either a private key or address to be set"));case 15:return t.prev=15,s=r.privateKey?this.tronWeb.address.fromPrivateKey(r.privateKey):r.address,t.next=19,this.tronWeb.transactionBuilder.unfreezeBalance(e,s,o);case 19:return a=t.sent,t.next=22,this.sign(a,r.privateKey||void 0);case 22:return i=t.sent,t.next=25,this.sendRawTransaction(i);case 25:return c=t.sent,t.abrupt("return",n(null,c));case 29:return t.prev=29,t.t0=t.catch(15),t.abrupt("return",n(t.t0));case 32:case"end":return t.stop()}}),t,this,[[15,29]])}))),function(){return c.apply(this,arguments)})},{key:"updateAccount",value:(i=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]&&c[0],r=c.length>1&&void 0!==c[1]?c[1]:{},o=c.length>2&&void 0!==c[2]&&c[2],Sr.isFunction(r)&&(o=r,r={}),"string"==typeof r&&(r={privateKey:r}),o){t.next=7;break}return t.abrupt("return",this.injectPromise(this.updateAccount,e,r));case 7:if(Sr.isString(e)&&e.length){t.next=9;break}return t.abrupt("return",o("Name must be a string"));case 9:if((r=io({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},r)).privateKey||r.address){t.next=12;break}return t.abrupt("return",o("Function requires either a private key or address to be set"));case 12:return t.prev=12,n=r.privateKey?this.tronWeb.address.fromPrivateKey(r.privateKey):r.address,t.next=16,this.tronWeb.transactionBuilder.updateAccount(e,n);case 16:return s=t.sent,t.next=19,this.sign(s,r.privateKey||void 0);case 19:return a=t.sent,t.next=22,this.sendRawTransaction(a);case 22:return i=t.sent,t.abrupt("return",o(null,i));case 26:return t.prev=26,t.t0=t.catch(12),t.abrupt("return",o(t.t0));case 29:case"end":return t.stop()}}),t,this,[[12,26]])}))),function(){return i.apply(this,arguments)})},{key:"signMessage",value:function(){return this.sign.apply(this,arguments)}},{key:"sendAsset",value:function(){return this.sendToken.apply(this,arguments)}},{key:"send",value:function(){return this.sendTransaction.apply(this,arguments)}},{key:"sendTrx",value:function(){return this.sendTransaction.apply(this,arguments)}},{key:"broadcast",value:function(){return this.sendRawTransaction.apply(this,arguments)}},{key:"broadcastHex",value:function(){return this.sendHexTransaction.apply(this,arguments)}},{key:"signTransaction",value:function(){return this.sign.apply(this,arguments)}},{key:"getProposal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?!Sr.isInteger(t)||t<0?e("Invalid proposalID provided"):void this.tronWeb.fullNode.request("wallet/getproposalbyid",{id:parseInt(t)},"post").then((function(t){e(null,t)})).catch((function(t){return e(t)})):this.injectPromise(this.getProposal,t)}},{key:"listProposals",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.listProposals);this.tronWeb.fullNode.request("wallet/listproposals",{},"post").then((function(e){var r=e.proposals;t(null,void 0===r?[]:r)})).catch((function(e){return t(e)}))}},{key:"getChainParameters",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.getChainParameters);this.tronWeb.fullNode.request("wallet/getchainparameters",{},"post").then((function(e){var r=e.chainParameter;t(null,void 0===r?[]:r)})).catch((function(e){return t(e)}))}},{key:"getAccountResources",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?this.tronWeb.isAddress(t)?void this.tronWeb.fullNode.request("wallet/getaccountresource",{address:this.tronWeb.address.toHex(t)},"post").then((function(t){e(null,t)})).catch((function(t){return e(t)})):e("Invalid address provided"):this.injectPromise(this.getAccountResources,t)}},{key:"getDelegatedResourceV2",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{confirmed:!0},o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Sr.isFunction(r)&&(o=r,r={confirmed:!0}),Sr.isFunction(e)&&(o=e,e=this.tronWeb.defaultAddress.hex),Sr.isFunction(t)&&(o=t,t=this.tronWeb.defaultAddress.hex,e=this.tronWeb.defaultAddress.hex),o?this.tronWeb.isAddress(t)&&this.tronWeb.isAddress(e)?void this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getdelegatedresourcev2"),{fromAddress:co(t),toAddress:co(e)},"post").then((function(t){o(null,t)})).catch((function(t){return o(t)})):o("Invalid address provided"):this.injectPromise(this.getDelegatedResourceV2,t,e,r)}},{key:"getDelegatedResourceAccountIndexV2",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{confirmed:!0},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sr.isFunction(e)&&(r=e,e={confirmed:!0}),Sr.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),r?this.tronWeb.isAddress(t)?void this.tronWeb[e.confirmed?"solidityNode":"fullNode"].request("wallet".concat(e.confirmed?"solidity":"","/getdelegatedresourceaccountindexv2"),{value:co(t)},"post").then((function(t){r(null,t)})).catch((function(t){return r(t)})):r("Invalid address provided"):this.injectPromise(this.getDelegatedResourceAccountIndexV2,t,e)}},{key:"getCanDelegatedMaxSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"BANDWIDTH",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{confirmed:!0},o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Sr.isFunction(r)&&(o=r,r={confirmed:!0}),Sr.isFunction(e)&&(o=e,e="BANDWIDTH"),Sr.isFunction(t)&&(o=t,t=this.tronWeb.defaultAddress.hex),o?this.tronWeb.isAddress(t)?void(this.validator.notValid([{name:"resource",type:"resource",value:e,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'}],o)||this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getcandelegatedmaxsize"),{owner_address:co(t),type:"ENERGY"===e?1:0},"post").then((function(t){o(null,t)})).catch((function(t){return o(t)}))):o("Invalid address provided"):this.injectPromise(this.getCanDelegatedMaxSize,t,e,r)}},{key:"getAvailableUnfreezeCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{confirmed:!0},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sr.isFunction(e)&&(r=e,e={confirmed:!0}),Sr.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),r?this.tronWeb.isAddress(t)?void this.tronWeb[e.confirmed?"solidityNode":"fullNode"].request("wallet".concat(e.confirmed?"solidity":"","/getavailableunfreezecount"),{owner_address:co(t)},"post").then((function(t){r(null,t)})).catch((function(t){return r(t)})):r("Invalid address provided"):this.injectPromise(this.getAvailableUnfreezeCount,t,e)}},{key:"getCanWithdrawUnfreezeAmount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{confirmed:!0},o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Sr.isFunction(r)&&(o=r,r={confirmed:!0}),Sr.isFunction(e)&&(o=e,e=Date.now()),Sr.isFunction(t)&&(o=t,t=this.tronWeb.defaultAddress.hex),o?this.tronWeb.isAddress(t)?!Sr.isInteger(e)||e<0?o("Invalid timestamp provided"):void this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getcanwithdrawunfreezeamount"),{owner_address:co(t),timestamp:e},"post").then((function(t){o(null,t)})).catch((function(t){return o(t)})):o("Invalid address provided"):this.injectPromise(this.getCanWithdrawUnfreezeAmount,t,e,r)}},{key:"getExchangeByID",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?!Sr.isInteger(t)||t<0?e("Invalid exchangeID provided"):void this.tronWeb.fullNode.request("wallet/getexchangebyid",{id:t},"post").then((function(t){e(null,t)})).catch((function(t){return e(t)})):this.injectPromise(this.getExchangeByID,t)}},{key:"listExchanges",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.listExchanges);this.tronWeb.fullNode.request("wallet/listexchanges",{},"post").then((function(e){var r=e.exchanges;t(null,void 0===r?[]:r)}),"post").catch((function(e){return t(e)}))}},{key:"listExchangesPaginated",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Sr.isFunction(e)&&(r=e,e=0),Sr.isFunction(t)&&(r=t,t=10),!r)return this.injectPromise(this.listExchangesPaginated,t,e);this.tronWeb.fullNode.request("wallet/getpaginatedexchangelist",{limit:t,offset:e},"post").then((function(t){var e=t.exchanges;r(null,void 0===e?[]:e)})).catch((function(t){return r(t)}))}},{key:"getNodeInfo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.getNodeInfo);this.tronWeb.fullNode.request("wallet/getnodeinfo",{},"post").then((function(e){t(null,e)}),"post").catch((function(e){return t(e)}))}},{key:"getTokenListByName",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Sr.isInteger(e)&&(e=e.toString()),Sr.isString(e)&&e.length?void this.tronWeb.fullNode.request("wallet/getassetissuelistbyname",{value:this.tronWeb.fromUtf8(e)},"post").then((function(e){if(Array.isArray(e.assetIssue))r(null,e.assetIssue.map((function(e){return t._parseToken(e)})));else if(!e.name)return r("Token does not exist");r(null,t._parseToken(e))})).catch((function(t){return r(t)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenListByName,e)}},{key:"getTokenByID",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Sr.isInteger(e)&&(e=e.toString()),Sr.isString(e)&&e.length?void this.tronWeb.fullNode.request("wallet/getassetissuebyid",{value:e},"post").then((function(e){if(!e.name)return r("Token does not exist");r(null,t._parseToken(e))})).catch((function(t){return r(t)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenByID,e)}},{key:"getReward",value:(a=g()(E.a.mark((function t(e){var r,o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},o=n.length>2&&void 0!==n[2]&&n[2],r.confirmed=!0,t.abrupt("return",this._getReward(e,r,o));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"getUnconfirmedReward",value:(s=g()(E.a.mark((function t(e){var r,o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},o=n.length>2&&void 0!==n[2]&&n[2],r.confirmed=!1,t.abrupt("return",this._getReward(e,r,o));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"getBrokerage",value:(n=g()(E.a.mark((function t(e){var r,o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},o=n.length>2&&void 0!==n[2]&&n[2],r.confirmed=!0,t.abrupt("return",this._getBrokerage(e,r,o));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"getUnconfirmedBrokerage",value:(o=g()(E.a.mark((function t(e){var r,o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},o=n.length>2&&void 0!==n[2]&&n[2],r.confirmed=!1,t.abrupt("return",this._getBrokerage(e,r,o));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"_getReward",value:(r=g()(E.a.mark((function t(){var e,r,o,n,s=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:this.tronWeb.defaultAddress.hex,r=s.length>1?s[1]:void 0,o=s.length>2&&void 0!==s[2]&&s[2],Sr.isFunction(r)&&(o=r,r={}),Sr.isFunction(e)?(o=e,e=this.tronWeb.defaultAddress.hex):Sr.isObject(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),o){t.next=7;break}return t.abrupt("return",this.injectPromise(this._getReward,e,r));case 7:if(!this.validator.notValid([{name:"origin",type:"address",value:e}],o)){t.next=9;break}return t.abrupt("return");case 9:n={address:co(e)},this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getReward"),n,"post").then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0===t.reward)return o("Not found.");o(null,t.reward)})).catch((function(t){return o(t)}));case 11:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"_getBrokerage",value:(e=g()(E.a.mark((function t(){var e,r,o,n,s=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:this.tronWeb.defaultAddress.hex,r=s.length>1?s[1]:void 0,o=s.length>2&&void 0!==s[2]&&s[2],Sr.isFunction(r)&&(o=r,r={}),Sr.isFunction(e)?(o=e,e=this.tronWeb.defaultAddress.hex):Sr.isObject(e)&&(r=e,e=this.tronWeb.defaultAddress.hex),o){t.next=7;break}return t.abrupt("return",this.injectPromise(this._getBrokerage,e,r));case 7:if(!this.validator.notValid([{name:"origin",type:"address",value:e}],o)){t.next=9;break}return t.abrupt("return");case 9:n={address:co(e)},this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getBrokerage"),n,"post").then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0===t.brokerage)return o("Not found.");o(null,t.brokerage)})).catch((function(t){return o(t)}));case 11:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}],[{key:"verifySignature",value:function(t,e,r){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t=t.replace(/^0x/,""),r=r.replace(/^0x/,"");var n=[].concat(L()(ct(o?"TRON Signed Message:\n32":"Ethereum Signed Message:\n32")),L()(Sr.code.hexStr2byteArray(t))),s=at(n),a=lt(s,{recoveryParam:"1c"==r.substring(128,130)?1:0,r:"0x"+r.substring(0,64),s:"0x"+r.substring(64,128)}),i="41"+a.substr(2),c=To.address.fromHex(i);return c==To.address.fromHex(e)}},{key:"verifyMessageV2",value:function(t,e){return Sr.message.verifyMessage(t,e)}},{key:"verifyTypedData",value:function(t,e,r,o,n){o=o.replace(/^0x/,"");var s=Sr._TypedDataEncoder.hash(t,e,r),a="41"+lt(s,{recoveryParam:"1c"==o.substring(128,130)?1:0,r:"0x"+o.substring(0,64),s:"0x"+o.substring(64,128)}).substr(2);return To.address.fromHex(a)==To.address.fromHex(n)}},{key:"signString",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=t.replace(/^0x/,"");var o={toHexString:function(){return"0x"+e},value:e},n=new ut(o),s=[].concat(L()(ct(r?"TRON Signed Message:\n32":"Ethereum Signed Message:\n32")),L()(Sr.code.hexStr2byteArray(t))),a=at(s),i=n.signDigest(a),c=["0x",i.r.substring(2),i.s.substring(2),Number(i.v).toString(16)].join("");return c}},{key:"signMessageV2",value:function(t,e){return Sr.message.signMessage(t,e)}},{key:"_signTypedData",value:function(t,e,r,o){return Sr.crypto._signTypedData(t,e,r,o)}}]),t}();function lo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function uo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?lo(Object(r),!0).forEach((function(e){W()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var go=function(t,e){return Be(t,e)},ho=function(){function t(e,r){v()(this,t),this.tronWeb=e.tronWeb,this.contract=e,this.abi=r,this.name=r.name||(r.name=r.type),this.inputs=r.inputs||[],this.outputs=r.outputs||[],this.functionSelector=function(t){if(t.stateMutability=t.stateMutability?t.stateMutability.toLowerCase():"nonpayable",t.type=t.type?t.type.toLowerCase():"","fallback"===t.type||"receive"===t.type)return"0x";var e=new Sr.ethersUtils.Interface([t]);return"event"===t.type?e.getEvent(t.name).format(Sr.ethersUtils.FormatTypes.sighash):e.getFunction(t.name).format(Sr.ethersUtils.FormatTypes.sighash)}(r),this.signature=this.tronWeb.sha3(this.functionSelector,!1).slice(0,8),this.injectPromise=Gr()(this),this.defaultOptions={feeLimit:this.tronWeb.feeLimit,callValue:0,userFeePercentage:100,shouldPollResponse:!1}}var e,r,o;return A()(t,[{key:"decodeInput",value:function(t){return go(this.inputs,"0x"+t)}},{key:"onMethod",value:function(){var t=this,e="";if(this.abi&&!/event/i.test(this.abi.type)){for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];e=Ae(this.abi,o)}return{call:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Sr.isFunction(r)&&(o=r,r={}),r=uo(uo({},r),{},{rawParameter:e}),t._call([],[],r,o)},send:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.tronWeb.defaultPrivateKey,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sr.isFunction(o)&&(n=o,o=t.tronWeb.defaultPrivateKey),Sr.isFunction(r)&&(n=r,r={}),r=uo(uo({},r),{},{rawParameter:e}),t._send([],[],r,o,n)},watch:function(){return t._watch.apply(t,arguments)}}}},{key:"_call",value:(o=g()(E.a.mark((function t(e,r){var o,n,s,a,i=this,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=c.length>2&&void 0!==c[2]?c[2]:{},n=c.length>3&&void 0!==c[3]&&c[3],Sr.isFunction(o)&&(n=o,o={}),n){t.next=5;break}return t.abrupt("return",this.injectPromise(this._call,e,r,o));case 5:if(e.length===r.length){t.next=7;break}return t.abrupt("return",n("Invalid argument count provided"));case 7:if(this.contract.address){t.next=9;break}return t.abrupt("return",n("Smart contract is missing address"));case 9:if(this.contract.deployed){t.next=11;break}return t.abrupt("return",n("Calling smart contracts requires you to load the contract first"));case 11:if(s=this.abi.stateMutability,["pure","view"].includes(s.toLowerCase())){t.next=14;break}return t.abrupt("return",n('Methods with state mutability "'.concat(s,'" must use send()')));case 14:o=uo(uo(uo({},this.defaultOptions),{},{from:this.tronWeb.defaultAddress.hex},o),{},{_isConstant:!0}),a=r.map((function(t,r){return{type:e[r],value:t}})),this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,o,a,!!o.from&&this.tronWeb.address.toHex(o.from),(function(t,e){if(t)return n(t);if(!Sr.hasProperty(e,"constant_result"))return n("Failed to execute");try{var r=e.constant_result[0].length;if(0===r||r%64==8){var o="The call has been reverted or has thrown an error.";if(0!==r){o+=" Error message: ";for(var s="",a=e.constant_result[0].substring(8),c=0;c<r-8;c+=64)s+=i.tronWeb.toUtf8(a.substring(c,c+64));o+=s.replace(/(\u0000|\u000b|\f)+/g," ").replace(/ +/g," ").replace(/\s+$/g,"")}return n(o)}var p=go(i.abi,"0x"+e.constant_result[0]);return 1===p.length&&1===Object.keys(p).length&&(p=p[0]),n(null,p)}catch(t){return n(t)}}));case 17:case"end":return t.stop()}}),t,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"_send",value:(r=g()(E.a.mark((function t(e,r){var o,n,s,a,i,c,p,l,u,d,h,f=this,y=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=y.length>2&&void 0!==y[2]?y[2]:{},n=y.length>3&&void 0!==y[3]?y[3]:this.tronWeb.defaultPrivateKey,s=y.length>4&&void 0!==y[4]&&y[4],Sr.isFunction(n)&&(s=n,n=this.tronWeb.defaultPrivateKey),Sr.isFunction(o)&&(s=o,o={}),s){t.next=7;break}return t.abrupt("return",this.injectPromise(this._send,e,r,o,n));case 7:if(e.length===r.length){t.next=9;break}throw new Error("Invalid argument count provided");case 9:if(this.contract.address){t.next=11;break}return t.abrupt("return",s("Smart contract is missing address"));case 11:if(this.contract.deployed){t.next=13;break}return t.abrupt("return",s("Calling smart contracts requires you to load the contract first"));case 13:if(a=this.abi.stateMutability,!["pure","view"].includes(a.toLowerCase())){t.next=16;break}return t.abrupt("return",s('Methods with state mutability "'.concat(a,'" must use call()')));case 16:return["payable"].includes(a.toLowerCase())||(o.callValue=0),o=uo(uo({},this.defaultOptions),{},{from:this.tronWeb.defaultAddress.hex},o),i=r.map((function(t,r){return{type:e[r],value:t}})),t.prev=19,c=n?this.tronWeb.address.fromPrivateKey(n):this.tronWeb.defaultAddress.base58,t.next=23,this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,o,i,this.tronWeb.address.toHex(c));case 23:if((p=t.sent).result&&p.result.result){t.next=26;break}return t.abrupt("return",s("Unknown error: "+JSON.stringify(p,null,2)));case 26:return t.next=28,this.tronWeb.trx.sign(p.transaction,n);case 28:if((l=t.sent).signature){t.next=33;break}if(n){t.next=32;break}return t.abrupt("return",s("Transaction was not signed properly"));case 32:return t.abrupt("return",s("Invalid private key provided"));case 33:return t.next=35,this.tronWeb.trx.sendRawTransaction(l);case 35:if(!(u=t.sent).code){t.next=40;break}return d={error:u.code,message:u.code},u.message&&(d.message=this.tronWeb.toUtf8(u.message)),t.abrupt("return",s(d));case 40:if(o.shouldPollResponse){t.next=42;break}return t.abrupt("return",s(null,l.txID));case 42:(h=function(){var t=g()(E.a.mark((function t(){var e,r,n,a=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(20!==(e=a.length>0&&void 0!==a[0]?a[0]:0)){t.next=3;break}return t.abrupt("return",s({error:"Cannot find result in solidity node",transaction:l}));case 3:return t.next=5,f.tronWeb.trx.getTransactionInfo(l.txID);case 5:if(r=t.sent,Object.keys(r).length){t.next=8;break}return t.abrupt("return",setTimeout((function(){h(e+1)}),3e3));case 8:if(!r.result||"FAILED"!==r.result){t.next=10;break}return t.abrupt("return",s({error:f.tronWeb.toUtf8(r.resMessage),transaction:l,output:r}));case 10:if(Sr.hasProperty(r,"contractResult")){t.next=12;break}return t.abrupt("return",s({error:"Failed to execute: "+JSON.stringify(r,null,2),transaction:l,output:r}));case 12:if(!o.rawResponse){t.next=14;break}return t.abrupt("return",s(null,r));case 14:if(1===(n=go(f.abi,"0x"+r.contractResult[0])).length&&1===Object.keys(n).length&&(n=n[0]),!o.keepTxID){t.next=18;break}return t.abrupt("return",s(null,[l.txID,n]));case 18:return t.abrupt("return",s(null,n));case 19:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}())(),t.next=49;break;case 46:return t.prev=46,t.t0=t.catch(19),t.abrupt("return",s(t.t0));case 49:case"end":return t.stop()}}),t,this,[[19,46]])}))),function(t,e){return r.apply(this,arguments)})},{key:"_watch",value:(e=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c=this,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]?p[0]:{},r=p.length>1&&void 0!==p[1]&&p[1],Sr.isFunction(e)&&(r=e,e={}),Sr.isFunction(r)){t.next=5;break}throw new Error("Expected callback to be provided");case 5:if(this.contract.address){t.next=7;break}return t.abrupt("return",r("Smart contract is missing address"));case 7:if(this.abi.type&&/event/i.test(this.abi.type)){t.next=9;break}return t.abrupt("return",r("Invalid method type for event watching"));case 9:if(this.tronWeb.eventServer){t.next=11;break}return t.abrupt("return",r("No event server configured"));case 11:return o=!1,n=!1,s=Date.now()-1e3,a=function(){var t=g()(E.a.mark((function t(){var r,o,a,i,p,l;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r={since:s,eventName:c.name,sort:"block_timestamp",blockNumber:"latest",filters:e.filters},e.size&&(r.size=e.size),e.resourceNode&&(/full/i.test(e.resourceNode)?r.onlyUnconfirmed=!0:r.onlyConfirmed=!0),t.next=6,c.tronWeb.event.getEventsByContractAddress(c.contract.address,r);case 6:return o=t.sent,a=o.sort((function(t,e){return e.block-t.block})),i=Hr()(a,1),p=i[0],l=o.filter((function(t,r){return!(e.resourceNode&&t.resourceNode&&e.resourceNode.toLowerCase()!==t.resourceNode.toLowerCase()||o.slice(0,r).some((function(e){return JSON.stringify(e)==JSON.stringify(t)}))||n&&!(t.block>n))})),p&&(n=p.block),t.abrupt("return",l);case 13:return t.prev=13,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 16:case"end":return t.stop()}}),t,null,[[0,13]])})));return function(){return t.apply(this,arguments)}}(),i=function(){o&&clearInterval(o),o=setInterval((function(){a().then((function(t){return t.forEach((function(t){r(null,Sr.parseEvent(t,c.abi))}))})).catch((function(t){return r(t)}))}),3e3)},t.next=18,a();case 18:return i(),t.abrupt("return",{start:i,stop:function(){o&&(clearInterval(o),o=!1)}});case 20:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),fo=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(v()(this,t),!e||!e instanceof To)throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.injectPromise=Gr()(this),this.address=o,this.abi=r,this.eventListener=!1,this.bytecode=!1,this.deployed=!1,this.lastBlock=!1,this.methods={},this.methodInstances={},this.props=[],this.tronWeb.isAddress(o)?this.deployed=!0:this.address=!1,this.loadAbi(r)}var e,r,o,n;return A()(t,[{key:"_getEvents",value:(n=g()(E.a.mark((function t(){var e,r,o,n,s,a,i=this,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=c.length>0&&void 0!==c[0]?c[0]:{},t.next=3,this.tronWeb.event.getEventsByContractAddress(this.address,e);case 3:return r=t.sent,o=r.sort((function(t,e){return e.block-t.block})),n=Hr()(o,1),s=n[0],a=r.filter((function(t,o){return!(e.resourceNode&&t.resourceNode&&e.resourceNode.toLowerCase()!==t.resourceNode.toLowerCase()||r.slice(0,o).some((function(e){return JSON.stringify(e)==JSON.stringify(t)}))||i.lastBlock&&!(t.block>i.lastBlock))})),s&&(this.lastBlock=s.block),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"_startEventListener",value:(o=g()(E.a.mark((function t(){var e,r,o=this,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.length>0&&void 0!==n[0]?n[0]:{},r=n.length>1?n[1]:void 0,Sr.isFunction(e)&&(r=e,e={}),this.eventListener&&clearInterval(this.eventListener),this.tronWeb.eventServer){t.next=6;break}throw new Error("Event server is not configured");case 6:if(this.address){t.next=8;break}throw new Error("Contract is not configured with an address");case 8:return this.eventCallback=r,t.next=11,this._getEvents(e);case 11:this.eventListener=setInterval((function(){o._getEvents(e).then((function(t){return t.forEach((function(t){o.eventCallback&&o.eventCallback(t)}))})).catch((function(t){console.error("Failed to get event list",t)}))}),3e3);case 12:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"_stopEventListener",value:function(){this.eventListener&&(clearInterval(this.eventListener),this.eventListener=!1,this.eventCallback=!1)}},{key:"hasProperty",value:function(t){return this.hasOwnProperty(t)||this.__proto__.hasOwnProperty(t)}},{key:"loadAbi",value:function(t){var e=this;this.abi=t,this.methods={},this.props.forEach((function(t){return delete e[t]})),t.forEach((function(t){if(t.type&&!/constructor|error/i.test(t.type)){var r=new ho(e,t),o=r.onMethod.bind(r),n=r.name,s=r.functionSelector,a=r.signature;e.methods[n]=o,e.methods[s]=o,e.methods[a]=o,e.methodInstances[n]=r,e.methodInstances[s]=r,e.methodInstances[a]=r,e.hasProperty(n)||(e[n]=o,e.props.push(n)),e.hasProperty(s)||(e[s]=o,e.props.push(s)),e.hasProperty(a)||(e[a]=o,e.props.push(a))}}))}},{key:"decodeInput",value:function(t){var e=t.substring(0,8),r=t.substring(8);if(!this.methodInstances[e])throw new Error("Contract method "+e+" not found");return{name:this.methodInstances[e].name,params:this.methodInstances[e].decodeInput(r)}}},{key:"new",value:(r=g()(E.a.mark((function t(e){var r,o,n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=c.length>1&&void 0!==c[1]?c[1]:this.tronWeb.defaultPrivateKey,o=c.length>2&&void 0!==c[2]&&c[2],Sr.isFunction(r)&&(o=r,r=this.tronWeb.defaultPrivateKey),o){t.next=5;break}return t.abrupt("return",this.injectPromise(this.new,e,r));case 5:return t.prev=5,n=this.tronWeb.address.fromPrivateKey(r),t.next=9,this.tronWeb.transactionBuilder.createSmartContract(e,n);case 9:return s=t.sent,t.next=12,this.tronWeb.trx.sign(s,r);case 12:return a=t.sent,t.next=15,this.tronWeb.trx.sendRawTransaction(a);case 15:if(!(i=t.sent).code){t.next=18;break}return t.abrupt("return",o({error:i.code,message:this.tronWeb.toUtf8(i.message)}));case 18:return t.next=20,Sr.sleep(3e3);case 20:return t.abrupt("return",this.at(a.contract_address,o));case 23:return t.prev=23,t.t0=t.catch(5),t.abrupt("return",o(t.t0));case 26:case"end":return t.stop()}}),t,this,[[5,23]])}))),function(t){return r.apply(this,arguments)})},{key:"at",value:(e=g()(E.a.mark((function t(e){var r,o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.length>1&&void 0!==n[1]&&n[1]){t.next=3;break}return t.abrupt("return",this.injectPromise(this.at,e));case 3:return t.prev=3,t.next=6,this.tronWeb.trx.getContract(e);case 6:if((o=t.sent).contract_address){t.next=9;break}return t.abrupt("return",r("Unknown error: "+JSON.stringify(o,null,2)));case 9:return this.address=o.contract_address,this.bytecode=o.bytecode,this.deployed=!0,this.loadAbi(o.abi&&o.abi.entrys?o.abi.entrys:[]),t.abrupt("return",r(null,this));case 16:if(t.prev=16,t.t0=t.catch(3),!t.t0.toString().includes("does not exist")){t.next=20;break}return t.abrupt("return",r("Contract has not been deployed on the network"));case 20:return t.abrupt("return",r(t.t0));case 21:case"end":return t.stop()}}),t,this,[[3,16]])}))),function(t){return e.apply(this,arguments)})},{key:"events",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Sr.isFunction(t)&&(e=t,t={}),!Sr.isFunction(e))throw new Error("Callback function expected");var r=this;return{start:function(){var o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return o?(r._startEventListener(t,e).then((function(){o()})).catch((function(t){o(t)})),this):(r._startEventListener(t,e),this)},stop:function(){r._stopEventListener()}}}}]),t}(),yo=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(v()(this,t),!e||!e instanceof To)throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.pluginNoOverride=["register"],this.disablePlugins=r.disablePlugins}return A()(t,[{key:"register",value:function(t,e){var r={requires:"0.0.0",components:{}},o={libs:[],plugged:[],skipped:[]};if(this.disablePlugins)return o.error="This instance of TronWeb has plugins disabled.",o;var n=new t(this.tronWeb);if(Sr.isFunction(n.pluginInterface)&&(r=n.pluginInterface(e)),!Lr.a.satisfies(To.version,r.requires))throw new Error("The plugin is not compatible with this version of TronWeb");if(r.fullClass){var s=n.constructor.name,a=s.substring(0,1).toLowerCase()+s.substring(1);s!==a&&(To[s]=t,this.tronWeb[a]=n,o.libs.push(s))}else for(var i in r.components)if(this.tronWeb.hasOwnProperty(i)){var c=r.components[i],p=this.tronWeb[i].pluginNoOverride||[];for(var l in c)"constructor"===l||this.tronWeb[i][l]&&(p.includes(l)||/^_/.test(l))?o.skipped.push(l):(this.tronWeb[i][l]=c[l].bind(this.tronWeb[i]),o.plugged.push(l))}return o}}]),t}(),vo=r(30),mo=r.n(vo),Ao=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v()(this,t),!(e&&e instanceof To))throw new Error("Expected instance of TronWeb");this.tronWeb=e,this.injectPromise=Gr()(this)}return A()(t,[{key:"setServer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"healthcheck";if(!e)return this.tronWeb.eventServer=!1;if(Sr.isString(e)&&(e=new Dr.HttpProvider(e)),!this.tronWeb.isValidProvider(e))throw new Error("Invalid event server provided");this.tronWeb.eventServer=e,this.tronWeb.eventServer.isConnected=function(){return t.tronWeb.eventServer.request(r).then((function(){return!0})).catch((function(){return!1}))}}},{key:"getEventsByContractAddress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=Object.assign({sinceTimestamp:0,eventName:!1,blockNumber:!1,size:20,page:1},e),n=o.sinceTimestamp,s=o.since,a=o.fromTimestamp,i=o.eventName,c=o.blockNumber,p=o.size,l=o.page,u=o.onlyConfirmed,d=o.onlyUnconfirmed,g=o.previousLastEventFingerprint,h=o.previousFingerprint,y=o.fingerprint,v=o.rawResponse,m=o.sort,A=o.filters;if(!r)return this.injectPromise(this.getEventsByContractAddress,t,e);if(a=a||n||s,!this.tronWeb.eventServer)return r("No event server configured");var B=[];if(!this.tronWeb.isAddress(t))return r("Invalid contract address provided");if(i&&!t)return r("Usage of event name filtering requires a contract address");if(void 0!==a&&!Sr.isInteger(a))return r("Invalid fromTimestamp provided");if(!Sr.isInteger(p))return r("Invalid size provided");if(p>200&&(console.warn("Defaulting to maximum accepted size: 200"),p=200),!Sr.isInteger(l))return r("Invalid page provided");if(c&&!i)return r("Usage of block number filtering requires an event name");t&&B.push(this.tronWeb.address.fromHex(t)),i&&B.push(i),c&&B.push(c);var b={size:p,page:l};return"object"===f()(A)&&Object.keys(A).length>0&&(b.filters=JSON.stringify(A)),a&&(b.fromTimestamp=b.since=a),u&&(b.only_confirmed=u),d&&!u&&(b.only_unconfirmed=d),m&&(b.sort=m),(y=y||h||g)&&(b.fingerprint=y),this.tronWeb.eventServer.request("event/contract/".concat(B.join("/"),"?").concat(mo.a.stringify(b))).then((function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t?Sr.isArray(t)?r(null,!0===v?t:t.map((function(t){return Sr.mapEvent(t)}))):r(t):r("Unknown error occurred")})).catch((function(t){return r(t.response&&t.response.data||t)}))}},{key:"getEventsByTransactionID",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sr.isFunction(e)&&(r=e,e={}),r?this.tronWeb.eventServer?this.tronWeb.eventServer.request("event/transaction/".concat(t)).then((function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t?Sr.isArray(t)?r(null,!0===e.rawResponse?t:t.map((function(t){return Sr.mapEvent(t)}))):r(t):r("Unknown error occurred")})).catch((function(t){return r(t.response&&t.response.data||t)})):r("No event server configured"):this.injectPromise(this.getEventsByTransactionID,t,e)}}]),t}();function Bo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function bo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Bo(Object(r),!0).forEach((function(e){W()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Co=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];v()(this,t),this.mainchain=o;var s=e.fullHost,a=e.fullNode,i=e.solidityNode,c=e.eventServer,p=e.mainGatewayAddress,l=e.sideGatewayAddress,u=e.sideChainId;this.sidechain=new r(s||a,s||i,s||c,n),this.isAddress=this.mainchain.isAddress,this.utils=this.mainchain.utils,this.setMainGatewayAddress(p),this.setSideGatewayAddress(l),this.setChainId(u),this.injectPromise=Gr()(this),this.validator=new Yr(this.sidechain);var d=this;this.sidechain.trx.sign=function(){return d.sign.apply(d,arguments)},this.sidechain.trx.multiSign=function(){return d.multiSign.apply(d,arguments)}}var e,r,o,n,s,a,i,c,p,l,u,d,h,f,y,m,B,b,C,w,T;return A()(t,[{key:"setMainGatewayAddress",value:function(t){if(!this.isAddress(t))throw new Error("Invalid main gateway address provided");this.mainGatewayAddress=t}},{key:"setSideGatewayAddress",value:function(t){if(!this.isAddress(t))throw new Error("Invalid side gateway address provided");this.sideGatewayAddress=t}},{key:"setChainId",value:function(t){if(!this.utils.isString(t)||!t)throw new Error("Invalid side chainId provided");this.chainId=t}},{key:"signTransaction",value:function(t,e){"string"==typeof t&&(t=this.utils.code.hexStr2byteArray(t));var r=this.utils.code.hexStr2byteArray(this.chainId),o=this.utils.code.hexStr2byteArray(e.txID).concat(r),n=this.sidechain.utils.ethersUtils.sha256(o),s=this.utils.crypto.ECKeySign(this.utils.code.hexStr2byteArray(n.replace(/^0x/,"")),t);return Array.isArray(e.signature)?e.signature.includes(s)||e.signature.push(s):e.signature=[s],e}},{key:"multiSign",value:(T=g()(E.a.mark((function t(){var e,r,o,n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]&&c[0],r=c.length>1&&void 0!==c[1]?c[1]:this.sidechain.defaultPrivateKey,o=c.length>2&&void 0!==c[2]&&c[2],n=c.length>3&&void 0!==c[3]&&c[3],this.utils.isFunction(o)&&(n=o,o=0),this.utils.isFunction(r)&&(n=r,r=this.mainchain.defaultPrivateKey,o=0),n){t.next=8;break}return t.abrupt("return",this.injectPromise(this.multiSign,e,r,o));case 8:if(this.utils.isObject(e)&&e.raw_data&&e.raw_data.contract){t.next=10;break}return t.abrupt("return",n("Invalid transaction provided"));case 10:if(e.raw_data.contract[0].Permission_id||!(o>0)){t.next=30;break}return e.raw_data.contract[0].Permission_id=o,s=this.sidechain.address.toHex(this.sidechain.address.fromPrivateKey(r)).toLowerCase(),t.next=15,this.sidechain.trx.getSignWeight(e,o);case 15:if("PERMISSION_ERROR"!==(a=t.sent).result.code){t.next=18;break}return t.abrupt("return",n(a.result.message));case 18:if(i=!1,a.permission.keys.map((function(t){t.address===s&&(i=!0)})),i){t.next=22;break}return t.abrupt("return",n(r+" has no permission to sign"));case 22:if(!a.approved_list||-1==a.approved_list.indexOf(s)){t.next=24;break}return t.abrupt("return",n(r+" already sign transaction"));case 24:if(!a.transaction||!a.transaction.transaction){t.next=29;break}(e=a.transaction.transaction).raw_data.contract[0].Permission_id=o,t.next=30;break;case 29:return t.abrupt("return",n("Invalid transaction provided"));case 30:return t.prev=30,t.abrupt("return",n(null,this.signTransaction(r,e)));case 34:t.prev=34,t.t0=t.catch(30),n(t.t0);case 37:case"end":return t.stop()}}),t,this,[[30,34]])}))),function(){return T.apply(this,arguments)})},{key:"sign",value:(w=g()(E.a.mark((function t(){var e,r,o,n,s,a,i=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]&&i[0],r=i.length>1&&void 0!==i[1]?i[1]:this.sidechain.defaultPrivateKey,o=!(i.length>2&&void 0!==i[2])||i[2],n=i.length>3&&void 0!==i[3]&&i[3],s=i.length>4&&void 0!==i[4]&&i[4],this.utils.isFunction(n)&&(s=n,n=!1),this.utils.isFunction(o)&&(s=o,o=!0,n=!1),this.utils.isFunction(r)&&(s=r,r=this.sidechain.defaultPrivateKey,o=!0,n=!1),s){t.next=10;break}return t.abrupt("return",this.injectPromise(this.sign,e,r,o,n));case 10:if(!this.utils.isString(e)){t.next=21;break}if(this.utils.isHex(e)){t.next=13;break}return t.abrupt("return",s("Expected hex message input"));case 13:return t.prev=13,a=this.sidechain.trx.signString(e,r,o),t.abrupt("return",s(null,a));case 18:t.prev=18,t.t0=t.catch(13),s(t.t0);case 21:if(this.utils.isObject(e)){t.next=23;break}return t.abrupt("return",s("Invalid transaction provided"));case 23:if(n||!e.signature){t.next=25;break}return t.abrupt("return",s("Transaction is already signed"));case 25:if(t.prev=25,n){t.next=30;break}if(this.sidechain.address.toHex(this.sidechain.address.fromPrivateKey(r)).toLowerCase()===this.sidechain.address.toHex(e.raw_data.contract[0].parameter.value.owner_address)){t.next=30;break}return t.abrupt("return",s("Private key does not match address in transaction"));case 30:return t.abrupt("return",s(null,this.signTransaction(r,e)));case 33:t.prev=33,t.t1=t.catch(25),s(t.t1);case 36:case"end":return t.stop()}}),t,this,[[13,18],[25,33]])}))),function(){return w.apply(this,arguments)})},{key:"depositTrx",value:(C=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=p.length>3&&void 0!==p[3]?p[3]:{},s=p.length>4&&void 0!==p[4]?p[4]:this.mainchain.defaultPrivateKey,a=p.length>5&&void 0!==p[5]&&p[5],this.utils.isFunction(s)&&(a=s,s=this.mainchain.defaultPrivateKey),this.utils.isFunction(n)&&(a=n,n={}),a){t.next=7;break}return t.abrupt("return",this.injectPromise(this.depositTrx,e,r,o,n,s));case 7:if(!this.validator.notValid([{name:"callValue",type:"integer",value:e,gte:0},{name:"depositFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:o,gte:0}],a)){t.next=9;break}return t.abrupt("return");case 9:return n=bo({callValue:Number(e)+Number(r),feeLimit:o},n),t.prev=10,t.next=13,this.mainchain.contract().at(this.mainGatewayAddress);case 13:return i=t.sent,t.next=16,i.depositTRX().send(n,s);case 16:return c=t.sent,t.abrupt("return",a(null,c));case 20:return t.prev=20,t.t0=t.catch(10),t.abrupt("return",a(t.t0));case 23:case"end":return t.stop()}}),t,this,[[10,20]])}))),function(t,e,r){return C.apply(this,arguments)})},{key:"depositTrc10",value:(b=g()(E.a.mark((function t(e,r,o,n){var s,a,i,c,p,l=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=l.length>4&&void 0!==l[4]?l[4]:{},a=l.length>5&&void 0!==l[5]?l[5]:this.mainchain.defaultPrivateKey,i=l.length>6&&void 0!==l[6]&&l[6],this.utils.isFunction(a)&&(i=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(s)&&(i=s,s={}),i){t.next=7;break}return t.abrupt("return",this.injectPromise(this.depositTrc10,e,r,o,n,s,a));case 7:if(!this.validator.notValid([{name:"tokenValue",type:"integer",value:r,gte:0},{name:"depositFee",type:"integer",value:o,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0},{name:"tokenId",type:"integer",value:e,gte:0}],i)){t.next=9;break}return t.abrupt("return");case 9:return s=bo(bo({tokenId:e,tokenValue:r,feeLimit:n},s),{},{callValue:o}),t.prev=10,t.next=13,this.mainchain.contract().at(this.mainGatewayAddress);case 13:return c=t.sent,t.next=16,c.depositTRC10(e,r).send(s,a);case 16:p=t.sent,i(null,p),t.next=23;break;case 20:return t.prev=20,t.t0=t.catch(10),t.abrupt("return",i(t.t0));case 23:case"end":return t.stop()}}),t,this,[[10,20]])}))),function(t,e,r,o){return b.apply(this,arguments)})},{key:"depositTrc",value:(B=g()(E.a.mark((function t(e,r,o,n,s){var a,i,c,p,l,u,d=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=d.length>5&&void 0!==d[5]?d[5]:{},i=d.length>6&&void 0!==d[6]?d[6]:this.mainchain.defaultPrivateKey,c=d.length>7&&void 0!==d[7]&&d[7],this.utils.isFunction(i)&&(c=i,i=this.mainchain.defaultPrivateKey),this.utils.isFunction(a)&&(c=a,a={}),c){t.next=7;break}return t.abrupt("return",this.injectPromise(this.depositTrc,e,r,o,n,s,a,i));case 7:if(!this.validator.notValid([{name:"functionSelector",type:"not-empty-string",value:e},{name:"num",type:"integer",value:r,gte:0},{name:"fee",type:"integer",value:o,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0},{name:"contractAddress",type:"address",value:s}],c)){t.next=9;break}return t.abrupt("return");case 9:if(a=bo(bo({feeLimit:n},a),{},{callValue:o,tokenId:"",tokenValue:0}),t.prev=10,p=null,"approve"!==e){t.next=21;break}return t.next=15,this.mainchain.contract().at(s);case 15:return l=t.sent,t.next=18,l.approve(this.mainGatewayAddress,r).send(a,i);case 18:p=t.sent,t.next=44;break;case 21:return t.next=23,this.mainchain.contract().at(this.mainGatewayAddress);case 23:u=t.sent,t.t0=e,t.next="depositTRC20"===t.t0?27:"depositTRC721"===t.t0?31:"retryDeposit"===t.t0?35:"retryMapping"===t.t0?39:43;break;case 27:return t.next=29,u.depositTRC20(s,r).send(a,i);case 29:return p=t.sent,t.abrupt("break",44);case 31:return t.next=33,u.depositTRC721(s,r).send(a,i);case 33:return p=t.sent,t.abrupt("break",44);case 35:return t.next=37,u.retryDeposit(r).send(a,i);case 37:return p=t.sent,t.abrupt("break",44);case 39:return t.next=41,u.retryMapping(r).send(a,i);case 41:return p=t.sent,t.abrupt("break",44);case 43:return t.abrupt("break",44);case 44:c(null,p),t.next=50;break;case 47:return t.prev=47,t.t1=t.catch(10),t.abrupt("return",c(t.t1));case 50:case"end":return t.stop()}}),t,this,[[10,47]])}))),function(t,e,r,o,n){return B.apply(this,arguments)})},{key:"approveTrc20",value:(m=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>3&&void 0!==c[3]?c[3]:{},s=c.length>4&&void 0!==c[4]?c[4]:this.mainchain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],i="approve",t.abrupt("return",this.depositTrc(i,e,0,r,o,n,s,a));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return m.apply(this,arguments)})},{key:"approveTrc721",value:(y=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>3&&void 0!==c[3]?c[3]:{},s=c.length>4&&void 0!==c[4]?c[4]:this.mainchain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],i="approve",t.abrupt("return",this.depositTrc(i,e,0,r,o,n,s,a));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return y.apply(this,arguments)})},{key:"depositTrc20",value:(f=g()(E.a.mark((function t(e,r,o,n){var s,a,i,c,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=p.length>4&&void 0!==p[4]?p[4]:{},a=p.length>5&&void 0!==p[5]?p[5]:this.mainchain.defaultPrivateKey,i=p.length>6&&void 0!==p[6]&&p[6],c="depositTRC20",t.abrupt("return",this.depositTrc(c,e,r,o,n,s,a,i));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e,r,o){return f.apply(this,arguments)})},{key:"depositTrc721",value:(h=g()(E.a.mark((function t(e,r,o,n){var s,a,i,c,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=p.length>4&&void 0!==p[4]?p[4]:{},a=p.length>5&&void 0!==p[5]?p[5]:this.mainchain.defaultPrivateKey,i=p.length>6&&void 0!==p[6]&&p[6],c="depositTRC721",t.abrupt("return",this.depositTrc(c,e,r,o,n,s,a,i));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e,r,o){return h.apply(this,arguments)})},{key:"mappingTrc",value:(d=g()(E.a.mark((function t(e,r,o,n){var s,a,i,c,p,l=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=l.length>4&&void 0!==l[4]?l[4]:{},a=l.length>5&&void 0!==l[5]?l[5]:this.mainchain.defaultPrivateKey,i=l.length>6?l[6]:void 0,this.utils.isFunction(a)&&(i=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(s)&&(i=s,s={}),i){t.next=7;break}return t.abrupt("return",this.injectPromise(this.mappingTrc,e,r,o,n,s,a));case 7:if(!this.validator.notValid([{name:"trxHash",type:"not-empty-string",value:e},{name:"mappingFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:o,gte:0}],i)){t.next=9;break}return t.abrupt("return");case 9:return e=e.startsWith("0x")?e:"0x"+e,s=bo(bo({feeLimit:o},s),{},{callValue:r}),t.prev=11,t.next=14,this.mainchain.contract().at(this.mainGatewayAddress);case 14:if(c=t.sent,p=null,"mappingTRC20"!==n){t.next=22;break}return t.next=19,c.mappingTRC20(e).send(s,a);case 19:p=t.sent,t.next=29;break;case 22:if("mappingTRC721"!==n){t.next=28;break}return t.next=25,c.mappingTRC721(e).send(s,a);case 25:p=t.sent,t.next=29;break;case 28:i(new Error("type must be trc20 or trc721"));case 29:i(null,p),t.next=35;break;case 32:return t.prev=32,t.t0=t.catch(11),t.abrupt("return",i(t.t0));case 35:case"end":return t.stop()}}),t,this,[[11,32]])}))),function(t,e,r,o){return d.apply(this,arguments)})},{key:"mappingTrc20",value:(u=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>3&&void 0!==c[3]?c[3]:{},s=c.length>4&&void 0!==c[4]?c[4]:this.mainchain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],i="mappingTRC20",t.abrupt("return",this.mappingTrc(e,r,o,i,n,s,a));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return u.apply(this,arguments)})},{key:"mappingTrc721",value:(l=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>3&&void 0!==c[3]?c[3]:{},s=c.length>4&&void 0!==c[4]?c[4]:this.mainchain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],i="mappingTRC721",t.abrupt("return",this.mappingTrc(e,r,o,i,n,s,a));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return l.apply(this,arguments)})},{key:"withdrawTrx",value:(p=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=p.length>3&&void 0!==p[3]?p[3]:{},s=p.length>4&&void 0!==p[4]?p[4]:this.mainchain.defaultPrivateKey,a=p.length>5&&void 0!==p[5]&&p[5],this.utils.isFunction(s)&&(a=s,s=this.mainchain.defaultPrivateKey),this.utils.isFunction(n)&&(a=n,n={}),a){t.next=7;break}return t.abrupt("return",this.injectPromise(this.withdrawTrx,e,r,o,n,s));case 7:if(!this.validator.notValid([{name:"callValue",type:"integer",value:e,gte:0},{name:"withdrawFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:o,gte:0}],a)){t.next=9;break}return t.abrupt("return");case 9:return n=bo({callValue:Number(e)+Number(r),feeLimit:o},n),t.prev=10,t.next=13,this.sidechain.contract().at(this.sideGatewayAddress);case 13:return i=t.sent,t.next=16,i.withdrawTRX().send(n,s);case 16:return c=t.sent,t.abrupt("return",a(null,c));case 20:return t.prev=20,t.t0=t.catch(10),t.abrupt("return",a(t.t0));case 23:case"end":return t.stop()}}),t,this,[[10,20]])}))),function(t,e,r){return p.apply(this,arguments)})},{key:"withdrawTrc10",value:(c=g()(E.a.mark((function t(e,r,o,n){var s,a,i,c,p,l=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=l.length>4&&void 0!==l[4]?l[4]:{},a=l.length>5&&void 0!==l[5]?l[5]:this.mainchain.defaultPrivateKey,i=l.length>6&&void 0!==l[6]&&l[6],this.utils.isFunction(a)&&(i=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(s)&&(i=s,s={}),i){t.next=7;break}return t.abrupt("return",this.injectPromise(this.withdrawTrc10,e,r,o,n,s,a));case 7:if(!this.validator.notValid([{name:"tokenId",type:"integer",value:e,gte:0},{name:"tokenValue",type:"integer",value:r,gte:0},{name:"withdrawFee",type:"integer",value:o,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0}],i)){t.next=9;break}return t.abrupt("return");case 9:return s=bo({tokenValue:r,tokenId:e,callValue:o,feeLimit:n},s),t.prev=10,t.next=13,this.sidechain.contract().at(this.sideGatewayAddress);case 13:return c=t.sent,t.next=16,c.withdrawTRC10(e,r).send(s,a);case 16:return p=t.sent,t.abrupt("return",i(null,p));case 20:return t.prev=20,t.t0=t.catch(10),t.abrupt("return",i(t.t0));case 23:case"end":return t.stop()}}),t,this,[[10,20]])}))),function(t,e,r,o){return c.apply(this,arguments)})},{key:"withdrawTrc",value:(i=g()(E.a.mark((function t(e,r,o,n,s){var a,i,c,p,l,u,d,h,f,y,v=this,m=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=m.length>5&&void 0!==m[5]?m[5]:{},i=m.length>6&&void 0!==m[6]?m[6]:this.mainchain.defaultPrivateKey,c=m.length>7&&void 0!==m[7]&&m[7],this.utils.isFunction(i)&&(c=i,i=this.mainchain.defaultPrivateKey),this.utils.isFunction(a)&&(c=a,a={}),c){t.next=7;break}return t.abrupt("return",this.injectPromise(this.withdrawTrc,e,r,o,n,s,a,i));case 7:if(!this.validator.notValid([{name:"functionSelector",type:"not-empty-string",value:e},{name:"numOrId",type:"integer",value:r,gte:0},{name:"withdrawFee",type:"integer",value:o,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0},{name:"contractAddress",type:"address",value:s}],c)){t.next=9;break}return t.abrupt("return");case 9:return a=bo(bo({feeLimit:n},a),{},{callValue:o}),p=[{type:"uint256",value:r}],t.prev=11,l=i?this.sidechain.address.fromPrivateKey(i):this.sidechain.defaultAddress.base58,t.next=15,this.sidechain.transactionBuilder.triggerSmartContract(s,e,a,p,this.sidechain.address.toHex(l));case 15:if((u=t.sent).result&&u.result.result){t.next=18;break}return t.abrupt("return",c("Unknown error: "+JSON.stringify(u.transaction,null,2)));case 18:return t.next=20,this.sidechain.trx.sign(u.transaction,i);case 20:if((d=t.sent).signature){t.next=25;break}if(i){t.next=24;break}return t.abrupt("return",c("Transaction was not signed properly"));case 24:return t.abrupt("return",c("Invalid private key provided"));case 25:return t.next=27,this.sidechain.trx.sendRawTransaction(d);case 27:if(!(h=t.sent).code){t.next=32;break}return f={error:h.code,message:h.code},h.message&&(f.message=this.sidechain.toUtf8(h.message)),t.abrupt("return",c(f));case 32:if(a.shouldPollResponse){t.next=34;break}return t.abrupt("return",c(null,d.txID));case 34:(y=function(){var t=g()(E.a.mark((function t(){var e,r,o,n=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(20!=(e=n.length>0&&void 0!==n[0]?n[0]:0)){t.next=3;break}return t.abrupt("return",c({error:"Cannot find result in solidity node",transaction:d}));case 3:return t.next=5,v.sidechain.trx.getTransactionInfo(d.txID);case 5:if(r=t.sent,Object.keys(r).length){t.next=8;break}return t.abrupt("return",setTimeout((function(){y(e+1)}),3e3));case 8:if(!r.result||"FAILED"!=r.result){t.next=10;break}return t.abrupt("return",c({error:v.sidechain.toUtf8(r.resMessage),transaction:d,output:r}));case 10:if(v.utils.hasProperty(r,"contractResult")){t.next=12;break}return t.abrupt("return",c({error:"Failed to execute: "+JSON.stringify(r,null,2),transaction:d,output:r}));case 12:if(!a.rawResponse){t.next=14;break}return t.abrupt("return",c(null,r));case 14:return 1===(o=decodeOutput(v.outputs,"0x"+r.contractResult[0])).length&&(o=o[0]),t.abrupt("return",c(null,o));case 17:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}())(),t.next=41;break;case 38:return t.prev=38,t.t0=t.catch(11),t.abrupt("return",c(t.t0));case 41:case"end":return t.stop()}}),t,this,[[11,38]])}))),function(t,e,r,o,n){return i.apply(this,arguments)})},{key:"withdrawTrc20",value:(a=g()(E.a.mark((function t(e,r,o,n,s){var a,i,c,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=p.length>5&&void 0!==p[5]?p[5]:this.mainchain.defaultPrivateKey,i=p.length>6&&void 0!==p[6]&&p[6],c="withdrawal(uint256)",t.abrupt("return",this.withdrawTrc(c,e,r,o,n,s,a,i));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e,r,o,n){return a.apply(this,arguments)})},{key:"withdrawTrc721",value:(s=g()(E.a.mark((function t(e,r,o,n,s){var a,i,c,p=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=p.length>5&&void 0!==p[5]?p[5]:this.mainchain.defaultPrivateKey,i=p.length>6&&void 0!==p[6]&&p[6],c="withdrawal(uint256)",t.abrupt("return",this.withdrawTrc(c,e,r,o,n,s,a,i));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e,r,o,n){return s.apply(this,arguments)})},{key:"injectFund",value:(n=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c,p,l,u,d=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=d.length>3&&void 0!==d[3]?d[3]:this.mainchain.defaultPrivateKey,s=d.length>4&&void 0!==d[4]&&d[4],this.utils.isFunction(n)&&(s=n,n=this.mainchain.defaultPrivateKey),this.utils.isFunction(o)&&(s=o,o={}),s){t.next=6;break}return t.abrupt("return",this.injectPromise(this.injectFund,e,r,o,n));case 6:if(!this.validator.notValid([{name:"num",type:"integer",value:e,gte:0},{name:"feeLimit",type:"integer",value:r,gte:0}],s)){t.next=8;break}return t.abrupt("return");case 8:return t.prev=8,a=this.sidechain.address.fromPrivateKey(n),i=this.sidechain.address.toHex(a),t.next=13,this.sidechain.fullNode.request("/wallet/fundinject",{owner_address:i,amount:e},"post");case 13:return c=t.sent,t.next=16,this.sidechain.trx.sign(c,n);case 16:if((p=t.sent).signature){t.next=21;break}if(n){t.next=20;break}return t.abrupt("return",s("Transaction was not signed properly"));case 20:return t.abrupt("return",s("Invalid private key provided"));case 21:return t.next=23,this.sidechain.trx.sendRawTransaction(p);case 23:if(!(l=t.sent).code){t.next=28;break}return u={error:l.code,message:l.code},l.message&&(u.message=this.mainchain.toUtf8(l.message)),t.abrupt("return",s(u));case 28:return t.abrupt("return",s(null,p.txID));case 31:return t.prev=31,t.t0=t.catch(8),t.abrupt("return",s(t.t0));case 34:case"end":return t.stop()}}),t,this,[[8,31]])}))),function(t,e,r){return n.apply(this,arguments)})},{key:"retryWithdraw",value:(o=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>3&&void 0!==c[3]?c[3]:{},s=c.length>4&&void 0!==c[4]?c[4]:this.sidechain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],i="retryWithdraw(uint256)",t.abrupt("return",this.withdrawTrc(i,e,r,o,this.sideGatewayAddress,n,s,a));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return o.apply(this,arguments)})},{key:"retryDeposit",value:(r=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>3&&void 0!==c[3]?c[3]:{},s=c.length>4&&void 0!==c[4]?c[4]:this.mainchain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],i="retryDeposit",t.abrupt("return",this.depositTrc(i,e,r,o,this.mainGatewayAddress,n,s,a));case 5:case"end":return t.stop()}}),t,this)}))),function(t,e,o){return r.apply(this,arguments)})},{key:"retryMapping",value:(e=g()(E.a.mark((function t(e,r,o){var n,s,a,i,c=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>3&&void 0!==c[3]?c[3]:{},s=c.length>4&&void 0!==c[4]?c[4]:this.mainchain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],i="retryMapping",t.abrupt("return",this.depositTrc(i,e,r,o,this.mainGatewayAddress,n,s,a));case 5:case"end":return t.stop()}}),t,this)}))),function(t,r,o){return e.apply(this,arguments)})}]),t}();function wo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,o=M()(t);if(e){var n=M()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return F()(this,r)}}var To=function(t){w()(s,t);var e,r,o,n=wo(s);function s(){var t,e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=arguments.length>4&&void 0!==arguments[4]&&arguments[4];v()(this,s),t=n.call(this);var p=!1,l=!1;return"object"===f()(r)&&(r.fullNode||r.fullHost)?(e=r.fullNode||r.fullHost,i=o,o=r.solidityNode||r.fullHost,a=r.eventServer||r.fullHost,p=r.headers||!1,l=r.eventHeaders||p,c=r.privateKey):e=r,Sr.isString(e)&&(e=new Dr.HttpProvider(e)),Sr.isString(o)&&(o=new Dr.HttpProvider(o)),Sr.isString(a)&&(a=new Dr.HttpProvider(a)),t.event=new Ao(b()(t)),t.transactionBuilder=new so(b()(t)),t.trx=new po(b()(t)),t.plugin=new yo(b()(t),r),t.utils=Sr,t.setFullNode(e),t.setSolidityNode(o),t.setEventServer(a),t.providers=Dr,t.BigNumber=xr.a,t.defaultBlock=!1,t.defaultPrivateKey=!1,t.defaultAddress={hex:!1,base58:!1},["sha3","toHex","toUtf8","fromUtf8","toAscii","fromAscii","toDecimal","fromDecimal","toSun","fromSun","toBigNumber","isAddress","createAccount","address","version","createRandom","fromMnemonic"].forEach((function(e){t[e]=s[e]})),"object"===f()(i)&&(i.fullNode||i.fullHost)?t.sidechain=new Co(i,s,b()(t),c):c=c||i,c&&t.setPrivateKey(c),t.fullnodeVersion="3.5.0",t.feeLimit=15e7,t.injectPromise=Gr()(b()(t)),p&&t.setFullNodeHeader(p),l&&t.setEventHeader(l),t}return A()(s,[{key:"getFullnodeVersion",value:(o=g()(E.a.mark((function t(){var e;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.trx.getNodeInfo();case 3:e=t.sent,this.fullnodeVersion=e.configNodeInfo.codeVersion,2===this.fullnodeVersion.split(".").length&&(this.fullnodeVersion+=".0"),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),this.fullnodeVersion="3.5.0";case 11:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(){return o.apply(this,arguments)})},{key:"setDefaultBlock",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if([!1,"latest","earliest",0].includes(t))return this.defaultBlock=t;if(!Sr.isInteger(t)||!t)throw new Error("Invalid block ID provided");this.defaultBlock=Math.abs(t)}},{key:"setPrivateKey",value:function(t){try{this.setAddress(this.address.fromPrivateKey(t))}catch(t){throw new Error("Invalid private key provided")}this.defaultPrivateKey=t,this.emit("privateKeyChanged",t)}},{key:"setAddress",value:function(t){if(!this.isAddress(t))throw new Error("Invalid address provided");var e=this.address.toHex(t),r=this.address.fromHex(t);this.defaultPrivateKey&&this.address.fromPrivateKey(this.defaultPrivateKey)!==r&&(this.defaultPrivateKey=!1),this.defaultAddress={hex:e,base58:r},this.emit("addressChanged",{hex:e,base58:r})}},{key:"fullnodeSatisfies",value:function(t){return Lr.a.satisfies(this.fullnodeVersion,t)}},{key:"isValidProvider",value:function(t){return Object.values(Dr).some((function(e){return t instanceof e}))}},{key:"setFullNode",value:function(t){if(Sr.isString(t)&&(t=new Dr.HttpProvider(t)),!this.isValidProvider(t))throw new Error("Invalid full node provided");this.fullNode=t,this.fullNode.setStatusPage("wallet/getnowblock"),this.getFullnodeVersion()}},{key:"setSolidityNode",value:function(t){if(Sr.isString(t)&&(t=new Dr.HttpProvider(t)),!this.isValidProvider(t))throw new Error("Invalid solidity node provided");this.solidityNode=t,this.solidityNode.setStatusPage("walletsolidity/getnowblock")}},{key:"setEventServer",value:function(){var t;(t=this.event).setServer.apply(t,arguments)}},{key:"setHeader",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Dr.HttpProvider(this.fullNode.host,3e4,!1,!1,t),r=new Dr.HttpProvider(this.solidityNode.host,3e4,!1,!1,t),o=new Dr.HttpProvider(this.eventServer.host,3e4,!1,!1,t);this.setFullNode(e),this.setSolidityNode(r),this.setEventServer(o)}},{key:"setFullNodeHeader",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Dr.HttpProvider(this.fullNode.host,3e4,!1,!1,t),r=new Dr.HttpProvider(this.solidityNode.host,3e4,!1,!1,t);this.setFullNode(e),this.setSolidityNode(r)}},{key:"setEventHeader",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Dr.HttpProvider(this.eventServer.host,3e4,!1,!1,t);this.setEventServer(e)}},{key:"currentProviders",value:function(){return{fullNode:this.fullNode,solidityNode:this.solidityNode,eventServer:this.eventServer}}},{key:"currentProvider",value:function(){return this.currentProviders()}},{key:"getEventResult",value:function(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return"object"!==f()(r[1])&&(r[1]={sinceTimestamp:r[1]||0,eventName:r[2]||!1,blockNumber:r[3]||!1,size:r[4]||20,page:r[5]||1},r.splice(2,4),Sr.isFunction(r[2])||(Sr.isFunction(r[1].page)?(r[2]=r[1].page,r[1].page=1):Sr.isFunction(r[1].size)&&(r[2]=r[1].size,r[1].size=20,r[1].page=1))),(t=this.event).getEventsByContractAddress.apply(t,r)}},{key:"getEventByTransactionID",value:function(){var t;return(t=this.event).getEventsByTransactionID.apply(t,arguments)}},{key:"contract",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new fo(this,t,e)}},{key:"isConnected",value:(r=g()(E.a.mark((function t(){var e,r=arguments;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=r.length>0&&void 0!==r[0]&&r[0]){t.next=3;break}return t.abrupt("return",this.injectPromise(this.isConnected));case 3:return t.t0=e,t.next=6,this.fullNode.isConnected();case 6:return t.t1=t.sent,t.next=9,this.solidityNode.isConnected();case 9:if(t.t2=t.sent,t.t3=this.eventServer,!t.t3){t.next=15;break}return t.next=14,this.eventServer.isConnected();case 14:t.t3=t.sent;case 15:return t.t4=t.t3,t.t5={fullNode:t.t1,solidityNode:t.t2,eventServer:t.t4},t.abrupt("return",(0,t.t0)(null,t.t5));case 18:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})}],[{key:"address",get:function(){return{fromHex:function(t){return Sr.isHex(t)?Sr.crypto.getBase58CheckAddress(Sr.code.hexStr2byteArray(t.replace(/^0x/,"41"))):t},toHex:function(t){return Sr.isHex(t)?t.toLowerCase().replace(/^0x/,"41"):Sr.code.byteArray2hexStr(Sr.crypto.decodeBase58Address(t)).toLowerCase()},fromPrivateKey:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return Sr.crypto.pkToAddress(t,e)}catch(t){return!1}}}}},{key:"sha3",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e?"0x":"")+at(Buffer.from(t,"utf-8")).toString().substring(2)}},{key:"toHex",value:function(t){if(Sr.isBoolean(t))return s.fromDecimal(+t);if(Sr.isBigNumber(t))return s.fromDecimal(t);if("object"===f()(t))return s.fromUtf8(JSON.stringify(t));if(Sr.isString(t)){if(/^(-|)0x/.test(t))return t;if(!isFinite(t)||/^\s*$/.test(t))return s.fromUtf8(t)}var e=s.fromDecimal(t);if("0xNaN"===e)throw new Error("The passed value is not convertible to a hex string");return e}},{key:"toUtf8",value:function(t){if(Sr.isHex(t))return t=t.replace(/^0x/,""),Buffer.from(t,"hex").toString("utf8");throw new Error("The passed value is not a valid hex string")}},{key:"fromUtf8",value:function(t){if(!Sr.isString(t))throw new Error("The passed value is not a valid utf-8 string");return"0x"+Buffer.from(t,"utf8").toString("hex")}},{key:"toAscii",value:function(t){if(Sr.isHex(t)){var e="",r=0,o=t.length;for("0x"===t.substring(0,2)&&(r=2);r<o;r+=2){var n=parseInt(t.substr(r,2),16);e+=String.fromCharCode(n)}return e}throw new Error("The passed value is not a valid hex string")}},{key:"fromAscii",value:function(t,e){if(!Sr.isString(t))throw new Error("The passed value is not a valid utf-8 string");return"0x"+Buffer.from(t,"ascii").toString("hex").padEnd(e,"0")}},{key:"toDecimal",value:function(t){return s.toBigNumber(t).toNumber()}},{key:"fromDecimal",value:function(t){var e=s.toBigNumber(t),r=e.toString(16);return e.isLessThan(0)?"-0x"+r.substr(1):"0x"+r}},{key:"fromSun",value:function(t){var e=s.toBigNumber(t).div(1e6);return Sr.isBigNumber(t)?e:e.toString(10)}},{key:"toSun",value:function(t){var e=s.toBigNumber(t).times(1e6);return Sr.isBigNumber(t)?e:e.toString(10)}},{key:"toBigNumber",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Sr.isBigNumber(t)?t:Sr.isString(t)&&/^(-|)0x/.test(t)?new xr.a(t.replace("0x",""),16):new xr.a(t.toString(10),10)}},{key:"isAddress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!Sr.isString(t))return!1;if(42===t.length)try{return s.isAddress(Sr.crypto.getBase58CheckAddress(Sr.code.hexStr2byteArray(t)))}catch(t){return!1}try{return Sr.crypto.isAddressValid(t)}catch(t){return!1}}},{key:"createAccount",value:(e=g()(E.a.mark((function t(){var e;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Sr.accounts.generateAccount(),t.abrupt("return",e);case 2:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"createRandom",value:function(t){return Sr.accounts.generateRandom(t)}},{key:"fromMnemonic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m/44'/195'/0'/0/0",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en",o=Sr.accounts.generateAccountWithMnemonic(t,e,r);return o}}]),s}(Ur.a);W()(To,"providers",Dr),W()(To,"BigNumber",xr.a),W()(To,"TransactionBuilder",so),W()(To,"Trx",po),W()(To,"Contract",fo),W()(To,"Plugin",yo),W()(To,"Event",Ao),W()(To,"version",Nr.a),W()(To,"utils",Sr)}]).default;
//# sourceMappingURL=TronWeb.node.js.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!