UNPKG

@hiero-ledger/sdk

Version:
3 lines (2 loc) 1.76 kB
import t,{TRANSACTION_REGISTRY as e}from"../transaction/Transaction.js";import i from"../file/FileId.js";import r from"../contract/ContractId.js";import o from"../Timestamp.js";class n extends t{constructor(t={}){super(),this._fileId=null,this._contractId=null,this._expirationTime=null,null!=t.fileId&&this.setFileId(t.fileId),null!=t.contractId&&this.setContractId(t.contractId),null!=t.expirationTime&&this.setExpirationTime(t.expirationTime)}static _fromProtobuf(e,s,a,l,c){const u=c[0].systemDelete;return t._fromProtobufTransactions(new n({fileId:null!=u.fileID?i._fromProtobuf(u.fileID):void 0,contractId:null!=u.contractID?r._fromProtobuf(u.contractID):void 0,expirationTime:null!=u.expirationTime?o._fromProtobuf(u.expirationTime):void 0}),e,s,a,l,c)}get fileId(){return this._fileId}setFileId(t){return this._requireNotFrozen(),this._fileId=t instanceof i?t:i.fromString(t),this}get contractId(){return this._contractId}setContractId(t){return this._requireNotFrozen(),this._contractId=t instanceof r?t:r.fromString(t),this}get expirationTime(){return this._expirationTime}setExpirationTime(t){return this._requireNotFrozen(),this._expirationTime=t,this}_execute(t,e){return null!=this._fileId?t.file.systemDelete(e):t.smartContract.systemDelete(e)}_getTransactionDataCase(){return"systemDelete"}_makeTransactionData(){return{fileID:null!=this._fileId?this._fileId._toProtobuf():null,contractID:null!=this._contractId?this._contractId._toProtobuf():null,expirationTime:null!=this._expirationTime?this._expirationTime._toProtobuf():null}}_getLogId(){return`SystemDeleteTransaction:${this._transactionIds.current.validStart.toString()}`}}e.set("systemDelete",n._fromProtobuf);export{n as default}; //# sourceMappingURL=SystemDeleteTransaction.js.map