diff --git a/src/at/did.gleam b/src/at/did.gleam index c03679e..bf35fb5 100644 --- a/src/at/did.gleam +++ b/src/at/did.gleam @@ -1,6 +1,5 @@ // IMPORTS --------------------------------------------------------------------- -import at/handle.{type Handle} import at/internal/ascii import at/internal/base32 import at/internal/hostname @@ -353,18 +352,6 @@ pub fn from_txt_records(records: List(String)) -> Result(Did, Nil) { } } -/// Construct the `did:web` [`Did`](#Did) from a given a [`Handle`](./handle#Handle). -/// This can fail if the handle is reserved or invalid, as these cannot be used -/// to construct a valid `did:web` identifier. -/// -pub fn from_handle(handle: Handle) -> Result(Did, Nil) { - case handle.kind(handle) { - handle.Normal | handle.Test -> - Ok(Did(method: Web, identifier: handle.to_string(handle), port: None)) - handle.Reserved | handle.Invalid -> Error(Nil) - } -} - /// A [`Decoder`](https://gleam-stdlib.hexdocs.pm/gleam/dynamic/decode.html#Decoder) /// for [`Did`](#Did) strings. You'll need this any time you want to decode a /// [`Did`](#Did) from a JSON payload, for example.