mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
labels: add easy autoloop labels
This commit is contained in:
parent
f4419aa424
commit
5cdf31bfc8
1 changed files with 18 additions and 0 deletions
|
|
@ -23,6 +23,14 @@ const (
|
|||
// autoIn is the label used for loop in swaps that are automatically
|
||||
// dispatched.
|
||||
autoIn = "autoloop-in"
|
||||
|
||||
// easyAutoOut is the label used for easy loop out swaps that are
|
||||
// automatically dispatched.
|
||||
easyAutoOut = "easy-autoloop-out"
|
||||
|
||||
// easyAutoIn is the label used for easy loop in swaps that are
|
||||
// automatically dispatched.
|
||||
easyAutoIn = "easy-autoloop-in"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -44,6 +52,16 @@ func AutoloopLabel(swapType swap.Type) string {
|
|||
return fmt.Sprintf("%v: %v", Reserved, autoIn)
|
||||
}
|
||||
|
||||
// EasyAutoloopLabel returns a label with the reserved prefix that identifies
|
||||
// automatically dispatched swaps depending on the type of swap being executed.
|
||||
func EasyAutoloopLabel(swapType swap.Type) string {
|
||||
if swapType == swap.TypeOut {
|
||||
return fmt.Sprintf("%v: %v", Reserved, easyAutoOut)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%v: %v", Reserved, easyAutoIn)
|
||||
}
|
||||
|
||||
// Validate checks that a label is of appropriate length and is not in our list
|
||||
// of reserved labels.
|
||||
func Validate(label string) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue