@@ -18,6 +18,7 @@ import (
1818 "github.com/lightninglabs/aperture/l402"
1919 "github.com/lightninglabs/lndclient"
2020 "github.com/lightninglabs/loop"
21+ "github.com/lightninglabs/loop/hyperloop"
2122 "github.com/lightninglabs/loop/instantout"
2223 "github.com/lightninglabs/loop/instantout/reservation"
2324 "github.com/lightninglabs/loop/labels"
@@ -83,6 +84,7 @@ type swapClientServer struct {
8384 lnd * lndclient.LndServices
8485 reservationManager * reservation.Manager
8586 instantOutManager * instantout.Manager
87+ hyperloopManager * hyperloop.Manager
8688 swaps map [lntypes.Hash ]loop.SwapInfo
8789 subscribers map [int ]chan <- interface {}
8890 statusChan chan loop.SwapInfo
@@ -91,6 +93,24 @@ type swapClientServer struct {
9193 mainCtx context.Context
9294}
9395
96+ func (s * swapClientServer ) HyperLoopOut (ctx context.Context ,
97+ req * clientrpc.HyperLoopOutRequest ) (
98+ * clientrpc.HyperLoopOutResponse , error ) {
99+
100+ log .Infof ("HyperLoop out request received" )
101+
102+ hyperloop , err := s .hyperloopManager .NewHyperLoopOut (
103+ ctx , btcutil .Amount (req .Amt ), req .CustomSweepAddr ,
104+ )
105+ if err != nil {
106+ return nil , err
107+ }
108+
109+ return & clientrpc.HyperLoopOutResponse {
110+ IdBytes : hyperloop .ID [:],
111+ }, nil
112+ }
113+
94114// LoopOut initiates a loop out swap with the given parameters. The call returns
95115// after the swap has been set up with the swap server. From that point onwards,
96116// progress can be tracked via the LoopOutStatus stream that is returned from
0 commit comments