mirror of
https://github.com/fiatjaf/nak.git
synced 2024-10-30 09:09:08 -04:00
generate keypair and display nsec.
This commit is contained in:
parent
7633eb3615
commit
c2a826e854
|
@ -80,6 +80,7 @@ object Components {
|
||||||
div(
|
div(
|
||||||
cls := "text-md",
|
cls := "text-md",
|
||||||
sk.map { k => entry("private key (hex)", k.value.toHex) },
|
sk.map { k => entry("private key (hex)", k.value.toHex) },
|
||||||
|
sk.map { k => entry("nsec", NIP19.encode(k)) },
|
||||||
entry("public key (hex)", pp.pubkey.value.toHex),
|
entry("public key (hex)", pp.pubkey.value.toHex),
|
||||||
if pp.relays.size > 0 then
|
if pp.relays.size > 0 then
|
||||||
Some(entry("relay hints", pp.relays.reduce((a, b) => s"$a, $b")))
|
Some(entry("relay hints", pp.relays.reduce((a, b) => s"$a, $b")))
|
||||||
|
|
|
@ -63,6 +63,15 @@ object Main extends IOWebApp {
|
||||||
.printWith(jsonPrinter)
|
.printWith(jsonPrinter)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
),
|
||||||
|
button(
|
||||||
|
Styles.button,
|
||||||
|
"generate keypair",
|
||||||
|
onClick --> (_.foreach(_ =>
|
||||||
|
store.input.set(
|
||||||
|
NIP19.encode(PrivateKey(randomBytes32()))
|
||||||
|
)
|
||||||
|
))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user