pub trait Select: Sized {
    fn zero() -> Self;
    fn checked_add(&self, rhs: &Self) -> Option<Self>;
    fn checked_sub(&self, rhs: &Self) -> Option<Self>;
    fn saturating_sub(&self, rhs: &Self) -> Self;
    fn compare(&self, other: &Self, output: &Self) -> Ordering;
}
Expand description

The Select trait offers an interface of UTxO selection.

Required Methods

Creates zero value of the UTxO type.

Computes self + rhs, returning None if overflow occurred.

Computes self - rhs, returning None if overflow occurred.

Computes self - rhs, saturating at the lowest bound if overflow occurred.

Compares two UTxOs to see which is better for the output, the less the better. A good strategy of UTxO selection should:

  • spend as fewer UTxOs as possible;
  • spend as fewer native assets as possible;
  • produce as fewer Dust as possible;

Implementors