@hiero-ledger/sdk
Version:
3 lines (2 loc) • 1.9 kB
JavaScript
import t from"./TokenId.js";import o from"../account/AccountId.js";import e from"long";class n{constructor(t={}){this._feeCollectorAccountId=null,null!=t.feeCollectorAccountId&&this.setFeeCollectorAccountId(t.feeCollectorAccountId),this._tokenId=null,null!=t.tokenId&&this.setTokenId(t.tokenId),this._amount=null,null!=t.amount&&this.setAmount(t.amount),this._payerAccountIds=null,null!=t.payerAccountIds&&this.setPayerAccountIds(t.payerAccountIds)}get feeCollectorAccountId(){return this._feeCollectorAccountId}setFeeCollectorAccountId(t){return this._feeCollectorAccountId="string"==typeof t?o.fromString(t):t,this}get tokenId(){return this._tokenId}setTokenId(o){return this._tokenId="string"==typeof o?t.fromString(o):o,this}get amount(){return this._amount}setAmount(t){return this._amount="number"==typeof t?e.fromNumber(t):t,this}get payerAccountIds(){return this._payerAccountIds}setPayerAccountIds(t){return this._payerAccountIds=t,this}static _fromProtobuf(e){return new n({feeCollectorAccountId:null!=e.feeCollectorAccountId?o._fromProtobuf(e.feeCollectorAccountId):void 0,tokenId:null!=e.tokenId?t._fromProtobuf(e.tokenId):void 0,amount:null!=e.amount?e.amount:void 0,payerAccountIds:null!=e.effectivePayerAccountId?e.effectivePayerAccountId.map((t=>o._fromProtobuf(t))):void 0})}_toProtobuf(){return{feeCollectorAccountId:null!=this.feeCollectorAccountId?this.feeCollectorAccountId._toProtobuf():null,tokenId:null!=this._tokenId?this._tokenId._toProtobuf():null,amount:this._amount,effectivePayerAccountId:null!=this._payerAccountIds?this._payerAccountIds.map((t=>t._toProtobuf())):null}}toJSON(){return{feeCollectorAccountId:this.feeCollectorAccountId?.toString()||null,tokenId:this._tokenId?.toString()||null,amount:this._amount?.toString()||null,payerAccountIds:this._payerAccountIds?.map((t=>t.toString()))||[]}}}export{n as default};
//# sourceMappingURL=AssessedCustomFee.js.map