BSV.Tokens.Error exception (bsv_sdk v1.1.0)

Copy Markdown View Source

Token error types.

Summary

Functions

Create an amount mismatch error.

Create an insufficient funds error.

Create an invalid authority error.

Create an invalid destination error.

Create an invalid scheme error.

Create an invalid script error.

Types

error_type()

@type error_type() ::
  :invalid_scheme
  | :amount_mismatch
  | :invalid_script
  | :invalid_destination
  | :invalid_authority
  | :signing_failed
  | :not_splittable
  | :insufficient_funds
  | :bundle_error

t()

@type t() :: %BSV.Tokens.Error{
  __exception__: true,
  message: String.t(),
  type: error_type()
}

Functions

amount_mismatch(expected, actual)

@spec amount_mismatch(non_neg_integer(), non_neg_integer()) :: t()

Create an amount mismatch error.

insufficient_funds(needed, available)

@spec insufficient_funds(non_neg_integer(), non_neg_integer()) :: t()

Create an insufficient funds error.

invalid_authority(msg)

@spec invalid_authority(String.t()) :: t()

Create an invalid authority error.

invalid_destination(msg)

@spec invalid_destination(String.t()) :: t()

Create an invalid destination error.

invalid_scheme(msg)

@spec invalid_scheme(String.t()) :: t()

Create an invalid scheme error.

invalid_script(msg)

@spec invalid_script(String.t()) :: t()

Create an invalid script error.