You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
loop/liquidity/restrictions.go

30 lines
677 B
Go

package liquidity
import (
"fmt"
"github.com/btcsuite/btcutil"
)
// Restrictions indicates the restrictions placed on a swap.
type Restrictions struct {
// Minimum is the minimum amount we can swap, inclusive.
Minimum btcutil.Amount
// Maximum is the maximum amount we can swap, inclusive.
Maximum btcutil.Amount
}
// String returns a string representation of a set of restrictions.
func (r *Restrictions) String() string {
return fmt.Sprintf("%v-%v", r.Minimum, r.Maximum)
}
// NewRestrictions creates a set of restrictions.
func NewRestrictions(minimum, maximum btcutil.Amount) *Restrictions {
return &Restrictions{
Minimum: minimum,
Maximum: maximum,
}
}