@@ -4,62 +4,9 @@ import (
44 "context"
55
66 "github.com/lightninglabs/lndclient"
7- "github.com/lightninglabs/taproot-assets/rfq"
87 "github.com/lightninglabs/taproot-assets/tapchannel"
9- "github.com/lightningnetwork/lnd/lnrpc/routerrpc"
10- "github.com/lightningnetwork/lnd/lnwire"
118)
129
13- // LndRouterClient is an LND router RPC client.
14- type LndRouterClient struct {
15- lnd * lndclient.LndServices
16- }
17-
18- // NewLndRouterClient creates a new LND router client for a given LND service.
19- func NewLndRouterClient (lnd * lndclient.LndServices ) * LndRouterClient {
20- return & LndRouterClient {
21- lnd : lnd ,
22- }
23- }
24-
25- // InterceptHtlcs intercepts all incoming HTLCs and calls the given handler
26- // function with the HTLC details. The handler function can then decide whether
27- // to accept or reject the HTLC.
28- func (l * LndRouterClient ) InterceptHtlcs (
29- ctx context.Context , handler lndclient.HtlcInterceptHandler ) error {
30-
31- return l .lnd .Router .InterceptHtlcs (ctx , handler )
32- }
33-
34- // AddLocalAlias adds a database mapping from the passed alias to the passed
35- // base SCID.
36- func (l * LndRouterClient ) AddLocalAlias (ctx context.Context , alias ,
37- baseScid lnwire.ShortChannelID ) error {
38-
39- return l .lnd .Router .XAddLocalChanAlias (ctx , alias , baseScid )
40- }
41-
42- // DeleteLocalAlias removes a mapping from the database and the Manager's maps.
43- func (l * LndRouterClient ) DeleteLocalAlias (ctx context.Context , alias ,
44- baseScid lnwire.ShortChannelID ) error {
45-
46- return l .lnd .Router .XDeleteLocalChanAlias (ctx , alias , baseScid )
47- }
48-
49- // SubscribeHtlcEvents subscribes to a stream of events related to
50- // HTLC updates.
51- func (l * LndRouterClient ) SubscribeHtlcEvents (
52- ctx context.Context ) (<- chan * routerrpc.HtlcEvent ,
53- <- chan error , error ) {
54-
55- return l .lnd .Router .SubscribeHtlcEvents (ctx )
56- }
57-
58- // Ensure LndRouterClient implements the rfq.HtlcInterceptor interface.
59- var _ rfq.HtlcInterceptor = (* LndRouterClient )(nil )
60- var _ rfq.ScidAliasManager = (* LndRouterClient )(nil )
61- var _ rfq.HtlcSubscriber = (* LndRouterClient )(nil )
62-
6310// LndInvoicesClient is an LND invoices RPC client.
6411type LndInvoicesClient struct {
6512 lnd * lndclient.LndServices
0 commit comments