Skip to content

Commit

Permalink
Merge branch 'feat/nwc-new-deeplink-flow' into feat/nwa
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Feb 1, 2025
2 parents 61903bc + 8cf4d15 commit df1560a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/NWCClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ export class NWCClient {
const onMessage = (message: {
data?: {
type: "nwc:success" | unknown;
nostrWalletConnectUrl?: string;
relayUrl?: string;
walletPubkey?: string;
lud16?: string;
};
origin: string;
}) => {
Expand All @@ -492,13 +494,18 @@ export class NWCClient {
data.type === "nwc:success" &&
message.origin === `${url.protocol}//${url.host}`
) {
if (!data.nostrWalletConnectUrl) {
reject(new Error("no nostrWalletConnectUrl in response"));
if (!data.relayUrl) {
reject(new Error("no relayUrl in response"));
}
if (!data.walletPubkey) {
reject(new Error("no walletPubkey in response"));
}
resolve(
new NWCClient({
nostrWalletConnectUrl: data.nostrWalletConnectUrl,
relayUrl: data.relayUrl,
walletPubkey: data.walletPubkey,
secret,
lud16: data.lud16,
}),
);
clearInterval(popupChecker);
Expand Down

0 comments on commit df1560a

Please sign in to comment.