using nostr-tools with a facade.

This commit is contained in:
fiatjaf
2022-03-05 13:21:21 -03:00
parent 892b2122b8
commit 3a97f7928b
6 changed files with 40 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import slinky.web.html._
import slinky.core.facade.Hooks._
import slinky.core.facade.Fragment
import app.modules.Nostr
import app.handlers.{Handler}
import app.components.{Item}
@@ -19,7 +20,9 @@ object KeyHandling extends Handler {
override val component = FunctionalComponent[String] { props =>
Fragment(
Item.component(Item.props("private key", "", props)),
Item.component(Item.props("public key", "", "soon to be shown here"))
Item.component(
Item.props("public key", "", Nostr.getPublicKey(props))
)
)
}
}

View File

@@ -0,0 +1,10 @@
package app.modules
import scala.scalajs.js.annotation._
import scala.scalajs.js
@js.native
@JSGlobal
object Nostr extends js.Object {
def getPublicKey(text: String): String = js.native
}