Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

fix: set onAuthFailed for reqs to lightning #13

Merged
merged 1 commit into from
Jun 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/middleware/lnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ export class MiddlewareLND extends ApiConnection {
requestFunc;
}

public set onAuthFailed(callback: (url: string) => void) {
this.channel.onAuthFailed =
this.info.onAuthFailed =
this.lightning.onAuthFailed =
this.transaction.onAuthFailed =
this.wallet.onAuthFailed =
this._onAuthFailed =
callback;
}

public async address(): Promise<NewAddressResponse> {
return await this.get<NewAddressResponse>('address');
}
Expand All @@ -54,6 +64,7 @@ export class MiddlewareLND extends ApiConnection {
await this.post<{signature: string}>('util/sign-message', {message})
).signature;
}

public async validateMessage(
message: string,
signature: string,
Expand Down