UNPKG

@hashgraph/sdk

Version:
3 lines (2 loc) 2.04 kB
import a from"./Hbar.js";import t from"./file/FileId.js";import e,{TRANSACTION_REGISTRY as l}from"./transaction/Transaction.js";class r extends e{constructor(a={}){super(),this._ethereumData=null,this._callDataFileId=null,this._maxGasAllowance=null,null!=a.ethereumData&&this.setEthereumData(a.ethereumData),null!=a.callData&&this.setCallDataFileId(a.callData),null!=a.callDataFileId&&this.setCallDataFileId(a.callDataFileId),null!=a.maxGasAllowance&&this.setMaxGasAllowanceHbar(a.maxGasAllowance)}static _fromProtobuf(l,s,n,i,o){const u=o[0].ethereumTransaction;return e._fromProtobufTransactions(new r({ethereumData:null!=u.ethereumData?u.ethereumData:void 0,callData:null!=u.callData?t._fromProtobuf(u.callData):void 0,maxGasAllowance:null!=u.maxGasAllowance?a.fromTinybars(u.maxGasAllowance):void 0}),l,s,n,i,o)}get ethereumData(){return this._ethereumData}setEthereumData(a){return this._requireNotFrozen(),this._ethereumData=a,this}get callData(){return this.callDataFileId}setCallData(a){return this.setCallDataFileId(a)}get callDataFileId(){return this._callDataFileId}setCallDataFileId(a){return this._requireNotFrozen(),this._callDataFileId=a,this}get maxGasAllowance(){return this._maxGasAllowance}setMaxGasAllowance(a){return this.setMaxGasAllowanceHbar(a)}setMaxGasAllowanceHbar(t){return this._requireNotFrozen(),this._maxGasAllowance=t instanceof a?t:new a(t),this}_validateChecksums(a){null!=this._ethereumData&&this._ethereumData instanceof t&&this._ethereumData.validateChecksum(a)}_execute(a,t){return a.smartContract.callEthereum(t)}_getTransactionDataCase(){return"ethereumTransaction"}_makeTransactionData(){return{ethereumData:this._ethereumData,callData:null!=this._callDataFileId?this._callDataFileId._toProtobuf():null,maxGasAllowance:null!=this._maxGasAllowance?this._maxGasAllowance.toTinybars():null}}_getLogId(){return`EthereumTransaction:${this._transactionIds.current.validStart.toString()}`}}l.set("ethereumTransaction",r._fromProtobuf);export{r as default}; //# sourceMappingURL=EthereumTransaction.js.map