Skip to content

Commit

Permalink
Аdd assessment method support for custom fractional fees (hashgraph#1600
Browse files Browse the repository at this point in the history
)

Signed-off-by: Petar Tonev <[email protected]>
  • Loading branch information
petreze authored May 2, 2023
1 parent f6df0d9 commit f2300a7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/token/CustomFractionalFee.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@

import CustomFee from "./CustomFee.js";
import AccountId from "../account/AccountId.js";
import FeeAssessmentMethod from "./FeeAssessmentMethod.js";
import Long from "long";

/**
* @typedef {import("./FeeAssessmentMethod.js").default} FeeAssessmentMethod
*/

/**
* @namespace proto
* @typedef {import("@hashgraph/proto").proto.ICustomFee} HashgraphProto.proto.ICustomFee
Expand Down Expand Up @@ -211,6 +208,10 @@ export default class CustomFractionalFee extends CustomFee {
: undefined,
min: fee.minimumAmount != null ? fee.minimumAmount : undefined,
max: fee.maximumAmount != null ? fee.maximumAmount : undefined,
assessmentMethod:
fee.netOfTransfers != null
? new FeeAssessmentMethod(fee.netOfTransfers)
: undefined,
});
}

Expand All @@ -233,6 +234,10 @@ export default class CustomFractionalFee extends CustomFee {
},
minimumAmount: this._min,
maximumAmount: this._max,
netOfTransfers:
this._assessmentMethod != null
? this._assessmentMethod.valueOf()
: false,
},
};
}
Expand Down

0 comments on commit f2300a7

Please sign in to comment.