Caravan Documentation
    Preparing search index...

    Function validateOutputAmount

    • Validate the given output amount (in Satoshis).

      • Must be a parseable as a number.

      • Cannot be negative (zero is OK).

      • Cannot be smaller than the limit set by DUST_LIMIT_SATS.

      • Cannot exceed the total input amount (this check is only run if inputsTotalSats is passed.

        TODO: minSats accepting a BigNumber is only to maintain some backward compatibility. Ideally, the arg would not expose this lib's dependencies to the caller. It should be made to only accept number or string.

      Parameters

      • amountSats: any
      • OptionalmaxSats: string | number
      • minSats: string | number | BigNumber = DUST_LIMIT_SATS

      Returns
          | ""
          | "Total input amount must be positive."
          | "Invalid total input amount."
          | "Invalid output amount."
          | "Output amount must be positive."
          | "Output amount is too small."
          | "Output amount is too large."