File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ class LND {
218218 }
219219
220220 /**
221- * LND ConnectPeer
221+ * LND ConnectPeer with pubkey and host
222222 * @returns {Promise<Ok<lnrpc.ConnectPeerResponse> | Err<unknown>> }
223223 * @param host
224224 * @param pubkey
@@ -241,6 +241,21 @@ class LND {
241241 }
242242 }
243243
244+ /**
245+ * LND ConnectPeer from single URI string
246+ * @returns {Promise<Ok<lnrpc.ConnectPeerResponse> | Err<unknown>> }
247+ * @param host
248+ * @param pubkey
249+ */
250+ async connectPeerFromUri ( uri : string ) : Promise < Result < lnrpc . ConnectPeerResponse > > {
251+ const params = uri . split ( '@' ) ;
252+ if ( params . length !== 2 ) {
253+ return err ( 'Invalid URI' ) ;
254+ }
255+
256+ return await this . connectPeer ( params [ 0 ] , params [ 1 ] ) ;
257+ }
258+
244259 /**
245260 * LND OpenChannelSync
246261 * @returns {Promise<Err<unknown, Error> | Ok<lnrpc.ChannelPoint, Error> | Err<unknown, any>> }
You can’t perform that action at this time.
0 commit comments