calculateTotalAmountToDeposit()
calculateTotalAmountToDeposit()
function calculateTotalAmountToDeposit(depositedAmount, totalFee): BN;Defined in: utils.ts:47
Calculate total amount of a Contract including all fees.
- first we convert fee floating to a BN with up to 4 decimals precision
- then we reverse the fee with
FEE_MULTIPLIERto safely multiply it by depositedAmount to receive a total number and not percentage of depositedAmount
Parameters
| Parameter | Type | Description |
|---|---|---|
depositedAmount | BN | deposited raw tokens |
totalFee | number | sum of all fees in percentage as floating number, e.g. 0.99% should be supplied as 0.99 |
Returns
BN
total tokens amount that Contract will retrieve from the Sender