@@ -89,6 +89,11 @@ type RouterClient interface {
8989	// will not be communicated to the channel peer via any message. 
9090	XDeleteLocalChanAlias (ctx  context.Context , alias ,
9191		baseScid  lnwire.ShortChannelID ) error 
92+ 
93+ 	// XFindBaseLocalChanAlias is an experimental API that looks up the base 
94+ 	// scid for a local chan alias that was registered. 
95+ 	XFindBaseLocalChanAlias (ctx  context.Context ,
96+ 		alias  lnwire.ShortChannelID ) (lnwire.ShortChannelID , error )
9297}
9398
9499// PaymentStatus describe the state of a payment. 
@@ -1174,3 +1179,25 @@ func (r *routerClient) XDeleteLocalChanAlias(ctx context.Context, alias,
11741179	)
11751180	return  err 
11761181}
1182+ 
1183+ // XFindBaseLocalChanAlias is an experimental API that looks up the base scid 
1184+ // for a local chan alias that was registered. 
1185+ func  (r  * routerClient ) XFindBaseLocalChanAlias (ctx  context.Context ,
1186+ 	alias  lnwire.ShortChannelID ) (lnwire.ShortChannelID , error ) {
1187+ 
1188+ 	rpcCtx , cancel  :=  context .WithTimeout (ctx , r .timeout )
1189+ 	defer  cancel ()
1190+ 
1191+ 	res , err  :=  r .client .XFindBaseLocalChanAlias (
1192+ 		r .routerKitMac .WithMacaroonAuth (rpcCtx ),
1193+ 		& routerrpc.FindBaseAliasRequest {
1194+ 			Alias : alias .ToUint64 (),
1195+ 		},
1196+ 	)
1197+ 
1198+ 	if  err  !=  nil  {
1199+ 		return  lnwire.ShortChannelID {}, err 
1200+ 	}
1201+ 
1202+ 	return  lnwire .NewShortChanIDFromInt (res .Base ), nil 
1203+ }
0 commit comments