atproto explorer
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add rotation keys

juliet.paris 2408254c 050f9248

verified
+33 -6
+33 -6
src/views/repo.tsx
··· 1 1 import { Client, CredentialManager } from "@atcute/client"; 2 - import { parsePublicMultikey } from "@atcute/crypto"; 2 + import { parseDidKey, parsePublicMultikey } from "@atcute/crypto"; 3 3 import { DidDocument } from "@atcute/identity"; 4 4 import { ActorIdentifier, Did, Handle, Nsid } from "@atcute/lexicons"; 5 5 import { A, useLocation, useNavigate, useParams } from "@solidjs/router"; ··· 38 38 const [filter, setFilter] = createSignal<string>(); 39 39 const [showFilter, setShowFilter] = createSignal(false); 40 40 const [validHandles, setValidHandles] = createStore<Record<string, boolean>>({}); 41 + const [rotationKeys, setRotationKeys] = createSignal<Array<string>>([]); 41 42 let rpc: Client; 42 43 let pds: string; 43 44 const did = params.repo; ··· 60 61 </A> 61 62 ); 62 63 64 + const getRotationKeys = async () => { 65 + const res = await fetch( 66 + `${localStorage.plcDirectory ?? "https://plc.directory"}/${did}/log/last`, 67 + ); 68 + const json = await res.json(); 69 + setRotationKeys(json.rotationKeys ?? []); 70 + }; 71 + 63 72 const fetchRepo = async () => { 64 73 try { 65 74 pds = await resolvePDS(did); ··· 78 87 } 79 88 } 80 89 setDidDoc(didDocCache[did] as DidDocument); 90 + getRotationKeys(); 91 + 81 92 validateHandles(); 82 93 83 94 rpc = new Client({ handler: new CredentialManager({ service: pds }) }); ··· 381 392 <div> 382 393 <div class="flex items-center gap-1"> 383 394 <div class="iconify lucide--shield-check" /> 384 - <p class="font-semibold">Verification methods</p> 395 + <p class="font-semibold">Verification Methods</p> 385 396 </div> 386 397 <ul> 387 398 <For each={didDocument().verificationMethod}> ··· 389 400 <Show when={verif.publicKeyMultibase}> 390 401 {(key) => ( 391 402 <li class="flex flex-col text-sm"> 392 - <span>#{verif.id.split("#")[1]}</span> 393 - <span class="flex items-center gap-0.5"> 394 - <div class="iconify lucide--key-round" /> 403 + <span> 404 + <span>#{verif.id.split("#")[1]}</span> 395 405 <ErrorBoundary fallback={<>unknown</>}> 396 - {parsePublicMultikey(key()).type} 406 + {" "} 407 + ({parsePublicMultikey(key()).type}) 397 408 </ErrorBoundary> 398 409 </span> 399 410 <span class="truncate">{key()}</span> 400 411 </li> 401 412 )} 402 413 </Show> 414 + )} 415 + </For> 416 + </ul> 417 + </div> 418 + <div> 419 + <div class="flex items-center gap-1"> 420 + <div class="iconify lucide--key-round" /> 421 + <p class="font-semibold">Rotation Keys</p> 422 + </div> 423 + <ul> 424 + <For each={rotationKeys()}> 425 + {(key) => ( 426 + <li class="text-xs"> 427 + <span>{key.replace("did:key:", "")}</span> 428 + <span> ({parseDidKey(key).type})</span> 429 + </li> 403 430 )} 404 431 </For> 405 432 </ul>