UNPKG

@hashgraph/sdk

Version:
3 lines (2 loc) 1.51 kB
import t from"./TokenId.js";import e,{TRANSACTION_REGISTRY as o}from"../transaction/Transaction.js";import s from"./CustomFixedFee.js";import r from"./CustomFractionalFee.js";import n from"./CustomRoyaltyFee.js";class u extends e{constructor(t={}){super(),this._tokenId=null,this._customFees=[],null!=t.tokenId&&this.setTokenId(t.tokenId),null!=t.customFees&&this.setCustomFees(t.customFees)}static _fromProtobuf(o,i,a,m,d){const c=d[0].tokenFeeScheduleUpdate;return e._fromProtobufTransactions(new u({tokenId:null!=c.tokenId?t._fromProtobuf(c.tokenId):void 0,customFees:null!=c.customFees?c.customFees.map(t=>null!=t.fixedFee?s._fromProtobuf(t):null!=t.fractionalFee?r._fromProtobuf(t):n._fromProtobuf(t)):void 0}),o,i,a,m,d)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId="string"==typeof e?t.fromString(e):t._fromProtobuf(e._toProtobuf()),this}get customFees(){return this._customFees}setCustomFees(t){return this._requireNotFrozen(),this._customFees=t,this}_execute(t,e){return t.token.updateTokenFeeSchedule(e)}_getTransactionDataCase(){return"tokenFeeScheduleUpdate"}_makeTransactionData(){return{tokenId:null!=this._tokenId?this._tokenId._toProtobuf():null,customFees:this._customFees.map(t=>t._toProtobuf())}}_getLogId(){return`TokenFeeScheduleUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}}o.set("tokenFeeScheduleUpdate",u._fromProtobuf);export{u as default}; //# sourceMappingURL=TokenFeeScheduleUpdateTransaction.js.map