keep parse result on Store.

This commit is contained in:
fiatjaf
2023-03-24 22:12:11 -03:00
parent b9fc27ea2f
commit 8961eddc43
3 changed files with 62 additions and 57 deletions

View File

@@ -3,13 +3,13 @@ import cats.syntax.all.*
import scoin.*
import snow.*
import Components.*
type Result = Either[
String,
Event | PrivateKey | AddressPointer | EventPointer | ProfilePointer
]
object Parser {
def parseInput(input: String): Either[
String,
Event | PrivateKey | AddressPointer | EventPointer | ProfilePointer
] =
def parseInput(input: String): Result =
NIP19.decode(input) match {
case Right(pp: ProfilePointer) => Right(pp)
case Right(evp: EventPointer) => Right(evp)