mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
Add a dedicated loop-in source enum to the liquidity parameters rpc and wire it through the internal parameter model and CLI. This keeps the source selection explicit before any static autoloop planning lands, so operators can choose between the legacy wallet-funded path and a future static-address-backed path without relying on implicit fallback behavior.
30 lines
706 B
Go
30 lines
706 B
Go
package liquidity
|
|
|
|
import "fmt"
|
|
|
|
// LoopInSource identifies the funding source that autoloop should use for loop
|
|
// in swaps.
|
|
type LoopInSource uint8
|
|
|
|
const (
|
|
// LoopInSourceWallet uses the legacy wallet-funded loop-in flow.
|
|
LoopInSourceWallet LoopInSource = iota
|
|
|
|
// LoopInSourceStaticAddress uses deposited static-address funds for
|
|
// loop-ins and does not fall back to wallet-funded loop-ins.
|
|
LoopInSourceStaticAddress
|
|
)
|
|
|
|
// String returns a human-readable representation of the source.
|
|
func (s LoopInSource) String() string {
|
|
switch s {
|
|
case LoopInSourceWallet:
|
|
return "wallet"
|
|
|
|
case LoopInSourceStaticAddress:
|
|
return "static-address"
|
|
|
|
default:
|
|
return fmt.Sprintf("unknown(%d)", s)
|
|
}
|
|
}
|