From b943aedcec59f11760044301e665c87fbe58ffab Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Sat, 08 Aug 2026 22:46:31 +0000 Subject: [PATCH] ✨ Add functions to create the request to resolve a handle or lookup its dns records. --- src/at/handle.gleam | 11 +++++++++++ 1 file(s) changed, 11 insertion(s)(+), 0 deletion(s)(-) diff --git a/src/at/handle.gleam b/src/at/handle.gleam --- a/src/at/handle.gleam +++ b/src/at/handle.gleam @@ -2,6 +2,7 @@ import at/internal/hostname import gleam/dynamic/decode.{type Decoder} +import gleam/http/request.{type Request} import gleam/json.{type Json} import gleam/string @@ -102,6 +103,10 @@ } } +pub fn dns_hostname(handle: Handle) -> String { + "_atproto." <> handle.hostname +} + // CONVERSIONS ----------------------------------------------------------------- pub fn to_string(handle: Handle) -> String { @@ -110,4 +115,10 @@ pub fn to_json(handle: Handle) -> Json { json.string(handle.hostname) +} + +pub fn resolve(handle: Handle) -> Request(String) { + request.new() + |> request.set_host(handle.hostname) + |> request.set_path("/.well-known/atproto-did") } -- tangled.sh