RadarTech / lnrpc

A Typescript gRPC client for LND with support for all LND sub-servers
MIT License
43 stars 13 forks source link

Event for disconnection of lnd ? #72

Open iangregsondev opened 4 years ago

iangregsondev commented 4 years ago

Hi,

I was wondering if there was some kind of discconection event / connection event so that we know when lnd is down ?

i.e. after this

(async () => {
  const lnRpcClient = await createLnRpc(config);

Is there a subscription that informs me that the lnRpc is down - hence the rpc is down, so I can re-act inside of my code ?

Specifically I want to work with typescript, but i was wondering if something existed in another library I found (but only javasript) - that gives the following

// Do something cool if we detect that the wallet is locked.
grpc.on(`locked`, () => console.log('wallet locked!'))

// Do something cool when the wallet gets unlocked.
grpc.on(`active`, () => console.log('wallet unlocked!'))

// Do something cool when the connection gets disconnected.
grpc.on(`disconnected`, () => console.log('disconnected from lnd!'))

Thanks in advance