aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/conversionFee.js
blob: 161f18e6cedc8fb0a5727ed99abfffb25f2efe9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Code for the conversion fee
// This is in a separate file so that the same function can be used by ./send and ./receive

const conversionFeeMultiplier = 0.01;
const conversionFeeReceiver = "coinosfees";  // account that receives the fees

/**
 * Returns the fee you have to pay for withdrawing 'amount' lightning BTC.
 */
function computeConversionFee(amount) {
  return Math.floor(amount * conversionFeeMultiplier);
}

module.exports.conversionFeeReceiver = conversionFeeReceiver;
module.exports.computeConversionFee = computeConversionFee;