2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-04 06:00:21 +00:00
loop/liquidity/restrictions.go
2022-03-25 11:00:16 +01:00

30 lines
682 B
Go

package liquidity
import (
"fmt"
"github.com/btcsuite/btcd/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,
}
}