RadarTech / lnrpc

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

QueryRoutesRequest requires optional fields #40

Closed wbobeirne closed 5 years ago

wbobeirne commented 5 years ago

Was just using queryRoutes, and was finding it was asking me for a bunch of fields I believe are optional. Here's the current type for it:

export interface QueryRoutesRequest {
  pubKey: string;
  amt?: string;
  numRoutes?: number;
  finalCltvDelta?: number;
  feeLimit?: FeeLimit;
  ignoredNodes: Buffer[] | string[];
  ignoredEdges: EdgeLocator[];
  sourcePubKey: string;
}

The docs say this about sourcePubKey:

The source node where the request route should originated from. If empty, self is assumed.

I'm pretty sure ignoredNodes and ignoredEdges are optional as well, since the call works fine without them.

I wasn't sure if these types were hand-written or not, so I didn't want to make a PR changing it if they're generated from something that needs to be fixed upstream.

cavanmflynn commented 5 years ago

We're generating types from the proto file, but not consuming them directly because the modifiers and types aren't perfect. They're mostly just used for diff purposes.

The documentation has been the best resource for determining if a property should be optional. You're correct about QueryRoutesRequest. Fixing this now.

cavanmflynn commented 5 years ago

The QueryRoutesRequest type has been fixed in v0.6.0-beta.2

wbobeirne commented 5 years ago

Good to know, I'll just file PRs myself for any future type issues. Frustrating that they don't come out right automatically. Thanks!