@hashgraph/sdk
Version:
3 lines (2 loc) • 1.25 kB
JavaScript
import t,{QUERY_REGISTRY as o}from"../query/Query.js";import e from"./TopicId.js";import s from"./TopicInfo.js";import"bignumber.js";import"../HbarUnit.js";import"long";class n extends t{constructor(t={}){super(),this._topicId=null,null!=t.topicId&&this.setTopicId(t.topicId)}static _fromProtobuf(t){const o=t.consensusGetTopicInfo;return new n({topicId:null!=o.topicID?e._fromProtobuf(o.topicID):void 0})}get topicId(){return this._topicId}setTopicId(t){return this._topicId="string"==typeof t?e.fromString(t):t.clone(),this}async getCost(t){return super.getCost(t)}_validateChecksums(t){null!=this._topicId&&this._topicId.validateChecksum(t)}_execute(t,o){return t.consensus.getTopicInfo(o)}_mapResponseHeader(t){return t.consensusGetTopicInfo.header}_mapResponse(t,o,e){return Promise.resolve(s._fromProtobuf(t.consensusGetTopicInfo))}_onMakeRequest(t){return{consensusGetTopicInfo:{header:t,topicID:null!=this._topicId?this._topicId._toProtobuf():null}}}_getLogId(){return`TopicInfoQuery:${(null!=this._paymentTransactionId&&null!=this._paymentTransactionId.validStart?this._paymentTransactionId.validStart:this._timestamp).toString()}`}}o.set("consensusGetTopicInfo",n._fromProtobuf);export{n as default};
//# sourceMappingURL=TopicInfoQuery.js.map