-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat: split nwc client from nostr webln provider (WIP)
Showing
4 changed files
with
993 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as crypto from "node:crypto"; // required in node.js | ||
global.crypto = crypto; // required in node.js | ||
import "websocket-polyfill"; // required in node.js | ||
|
||
import * as readline from "node:readline/promises"; | ||
import { stdin as input, stdout as output } from "node:process"; | ||
|
||
import { nwc } from "../../../dist/index.module.js"; | ||
|
||
const rl = readline.createInterface({ input, output }); | ||
|
||
const nwcUrl = | ||
process.env.NWC_URL || | ||
(await rl.question("Nostr Wallet Connect URL (nostr+walletconnect://...): ")); | ||
rl.close(); | ||
|
||
const client = new nwc.NWCClient({ | ||
nostrWalletConnectUrl: nwcUrl, | ||
}); | ||
const response = await client.getInfo(); | ||
|
||
console.info(response); | ||
|
||
client.close(); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.