UNPKG

@hashgraph/sdk

Version:
3 lines (2 loc) 1.27 kB
import t,{QUERY_REGISTRY as o}from"../query/Query.js";import n from"./AccountId.js";import r from"./AccountInfo.js";import"bignumber.js";import"../HbarUnit.js";import"long";class c extends t{constructor(t={}){super(),this._accountId=null,null!=t.accountId&&this.setAccountId(t.accountId)}static _fromProtobuf(t){const o=t.cryptoGetInfo;return new c({accountId:null!=o.accountID?n._fromProtobuf(o.accountID):void 0})}get accountId(){return this._accountId}setAccountId(t){return this._accountId="string"==typeof t?n.fromString(t):t.clone(),this}_validateChecksums(t){null!=this._accountId&&this._accountId.validateChecksum(t)}_execute(t,o){return t.crypto.getAccountInfo(o)}async getCost(t){return super.getCost(t)}_mapResponseHeader(t){return t.cryptoGetInfo.header}_mapResponse(t,o,n){const c=t.cryptoGetInfo;return Promise.resolve(r._fromProtobuf(c.accountInfo))}_onMakeRequest(t){return{cryptoGetInfo:{header:t,accountID:null!=this._accountId?this._accountId._toProtobuf():null}}}_getLogId(){return`AccountInfoQuery:${(null!=this._paymentTransactionId&&null!=this._paymentTransactionId.validStart?this._paymentTransactionId.validStart:this._timestamp).toString()}`}}o.set("cryptoGetInfo",c._fromProtobuf);export{c as default}; //# sourceMappingURL=AccountInfoQuery.js.map