-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: NWC connector 🤙 #2898
feat: NWC connector 🤙 #2898
Conversation
New and updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
…sion into feat/nwc
…sion into feat/nwc
fix getInfo, sendPayment, keysend, checkPayment, makeInvoice
} | ||
|
||
async getBalance(): Promise<GetBalanceResponse> { | ||
const balance = await this.nwc.getBalance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this methods might raise an error if the call fails (like for example if the method is not implemented).
so I think we need to catch them here and return a proper internal error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also be able to know if the method is supported here, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not here unless we call getInfo
first somewhere in the connector, like in the init
function. Is that fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking to do that. would be something against it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bumi I tested it with mutiny but mutiny doesn't even support get_info yet so the TestConnection doesn't even work. I will let them know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT: if getInfo fails it should just fallback to ["pay_invoice"] as the supported methods. Something must be wrong here in the JS SDK, I'll check again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix here: getAlby/js-sdk#171
But it does mean that currently we have to wait for the timeout (60 seconds) before the fallback is returned. This is a bit unusable. I think maybe we should be able to provide a shorter timeout to Alby JS SDK for some NWC methods, what do you think?
* master: feat: NWC connector 🤙 (#2898)
Describe the changes you have made in this PR
Fixes #2891
TODO
Still quite some stuff work on, but I figured I'd share my excitement for this early on. 🔥