feeCalculator function

BigInt feeCalculator(
  1. int inputs,
  2. int outputs,
  3. BigInt byteFee,
  4. int coinType,
)

Implementation

BigInt feeCalculator(int inputs, int outputs, BigInt byteFee, int coinType) {
  switch (coinType) {
    case TWCoinType.TWCoinTypeDecred:
      return _decredFeeCalculator(inputs, outputs, byteFee);

    case TWCoinType.TWCoinTypeBitcoin:
    case TWCoinType.TWCoinTypeBitcoinGold:
    case TWCoinType.TWCoinTypeDigiByte:
    case TWCoinType.TWCoinTypeLitecoin:
    case TWCoinType.TWCoinTypeViacoin:
    case TWCoinType.TWCoinTypeGroestlcoin:
      return _segwitFeeCalculator(inputs, outputs, byteFee);

    default:
      return _defaultFeeCalculator(inputs, outputs, byteFee);
  }
}