UNPKG

@hashgraph/sdk

Version:
3 lines (2 loc) 2.06 kB
import t from"./CustomFee.js";import e from"../account/AccountId.js";import o from"./FeeAssessmentMethod.js";import n from"long";class r extends t{constructor(t={}){super(t),this._numerator=null,null!=t.numerator&&this.setNumerator(t.numerator),this._denominator=null,null!=t.denominator&&this.setDenominator(t.denominator),this._min=null,null!=t.min&&this.setMin(t.min),this._max,null!=t.max&&this.setMax(t.max),this._assessmentMethod,null!=t.assessmentMethod&&this.setAssessmentMethod(t.assessmentMethod)}get numerator(){return this._numerator}setNumerator(t){return this._numerator="number"==typeof t?n.fromNumber(t):t,this}get denominator(){return this._denominator}setDenominator(t){return this._denominator="number"==typeof t?n.fromNumber(t):t,this}get min(){return this._min}setMin(t){return this._min="number"==typeof t?n.fromNumber(t):t,this}get max(){return this._max}setMax(t){return this._max="number"==typeof t?n.fromNumber(t):t,this}get assessmentMethod(){return this._assessmentMethod}setAssessmentMethod(t){return this._assessmentMethod=t,this}static _fromProtobuf(t){const n=t.fractionalFee,s=n.fractionalAmount;return new r({feeCollectorAccountId:null!=t.feeCollectorAccountId?e._fromProtobuf(t.feeCollectorAccountId):void 0,allCollectorsAreExempt:null!=t.allCollectorsAreExempt?t.allCollectorsAreExempt:void 0,numerator:null!=s.numerator?s.numerator:void 0,denominator:null!=s.denominator?s.denominator:void 0,min:null!=n.minimumAmount?n.minimumAmount:void 0,max:null!=n.maximumAmount?n.maximumAmount:void 0,assessmentMethod:null!=n.netOfTransfers?new o(n.netOfTransfers):void 0})}_toProtobuf(){return{feeCollectorAccountId:null!=this.feeCollectorAccountId?this.feeCollectorAccountId._toProtobuf():null,allCollectorsAreExempt:this.allCollectorsAreExempt,fractionalFee:{fractionalAmount:{numerator:this._numerator,denominator:this._denominator},minimumAmount:this._min,maximumAmount:this._max,netOfTransfers:null!=this._assessmentMethod&&this._assessmentMethod.valueOf()}}}}export{r as default}; //# sourceMappingURL=CustomFractionalFee.js.map