In preparation for adding loop in swaps, we relate liquidity rules
to a specific type of swap that we want to dispatch. This allows us
to use a single rule format for multiple swap types.
To allow code with more up-to-date dependencies to import loop, we
bump our lndclient version. The minimum loop version remains 11.1
since we're not using any new apis.
In this commit we add a call to the new probe endpoint directly into the
loop-in quote call. Furthermore we add an option to include private
channels in the loopin swap payment request. This is also useful for when
users quote/probe directly using the client API and specify hop hints.
This commit adds verification to the loop out request to ensure that the
formatting of the specified destination address matches the network that
lnd is running on.
This commit moves loop out request validation for labels and
confirmation targets into its own function for the purpose of easy
testing and also to make the additions of future request validation easy
to add and test.
In an effort to surface more information about why autoloop is not
executing, we add an error when suggest swaps is called with no rules.
In other cases we can surface a reason enum with each rule that is set,
but in the case where we have no rules, there are no results to
accompany with reasons.
To itest our autolooper, we need to be able to trigger dispatch on
demand. This functionality is included in a separate rpc server behind
a dev flag. Since it is unlikely that we need to split loop into
multiple rpc servers, this commit simply adds an additional debug server
rather than opting for a full subserver setup.
Previously labels with reserved prefixes were added to provide us
with a way to identify automatically dispatched loops. This commit moves
the validation of these labels to the rpc level so that it will only
apply to user-initiated swaps.
This commit updates swap suggestions to return loop out requests with
sufficient fields populated so that a loop out can directly be
dispatched from a suggestion. This requires setting of fees an min
sweep conf targets (our htlc conf target and addresss will be set by
the daemon's client rpc server if we do not provide them). We also do
some test refactoring so that we can more easily test the suggest swaps
endpoint.
To provide more information about swaps, we add a failure reason field
to our swaps. We do not extend our existing state enum to remain
backwards compatible.