Skip to content

Commit 7d26d2d

Browse files
committed
litclient: add and export JSON Callback registration funcs
This commit adds a new litclient package which can hold anything that LiT clients may want to import. In this commit, we add and export a list of JSON call back registration functions that a client will have access to when using Lit.
1 parent a261564 commit 7d26d2d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

litclient/jsoncallbacks.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package litclient
2+
3+
import (
4+
"context"
5+
6+
"github.com/lightninglabs/faraday/frdrpc"
7+
"github.com/lightninglabs/loop/looprpc"
8+
"github.com/lightninglabs/pool/poolrpc"
9+
"github.com/lightningnetwork/lnd/lnrpc"
10+
"github.com/lightningnetwork/lnd/lnrpc/autopilotrpc"
11+
"github.com/lightningnetwork/lnd/lnrpc/chainrpc"
12+
"github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"
13+
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
14+
"github.com/lightningnetwork/lnd/lnrpc/signrpc"
15+
"github.com/lightningnetwork/lnd/lnrpc/verrpc"
16+
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"
17+
"github.com/lightningnetwork/lnd/lnrpc/watchtowerrpc"
18+
"github.com/lightningnetwork/lnd/lnrpc/wtclientrpc"
19+
"google.golang.org/grpc"
20+
)
21+
22+
// StubPackageRegistration defines the signature of a function that maps JSON
23+
// method URIs to the function that should be called to handle the method.
24+
type StubPackageRegistration func(map[string]func(context.Context,
25+
*grpc.ClientConn, string, func(string, error)))
26+
27+
// Registrations defines a list of StubPackageRegistrations that a lit client
28+
// will have access to when using Lit.
29+
var Registrations = []StubPackageRegistration{
30+
lnrpc.RegisterLightningJSONCallbacks,
31+
lnrpc.RegisterStateJSONCallbacks,
32+
autopilotrpc.RegisterAutopilotJSONCallbacks,
33+
chainrpc.RegisterChainNotifierJSONCallbacks,
34+
invoicesrpc.RegisterInvoicesJSONCallbacks,
35+
routerrpc.RegisterRouterJSONCallbacks,
36+
signrpc.RegisterSignerJSONCallbacks,
37+
verrpc.RegisterVersionerJSONCallbacks,
38+
walletrpc.RegisterWalletKitJSONCallbacks,
39+
watchtowerrpc.RegisterWatchtowerJSONCallbacks,
40+
wtclientrpc.RegisterWatchtowerClientJSONCallbacks,
41+
looprpc.RegisterSwapClientJSONCallbacks,
42+
poolrpc.RegisterTraderJSONCallbacks,
43+
frdrpc.RegisterFaradayServerJSONCallbacks,
44+
}

0 commit comments

Comments
 (0)