# API reference

The 43 names `fastatp` exports, grouped by the module that
defines them. Import each one from the top: `from fastatp import Peer`.

## `fastatp.authz.attestation`

- [`Attestation`](https://fastatp.com/api/attestation.md): A signed pointer to a WireGuard-reachable repo, bound to a context.

## `fastatp.crypto`

- [`Signer`](https://fastatp.com/api/signer.md): Something that signs with a key it may not be able to hand over.
- [`SoftwareSigner`](https://fastatp.com/api/softwaresigner.md): A Signer holding a cryptography private key in memory.

## `fastatp.did.document`

- [`DIDDocument`](https://fastatp.com/api/diddocument.md)
- [`build_did_document`](https://fastatp.com/api/build-did-document.md): Construct a valid atproto-shaped DID document.

## `fastatp.did.plc`

- [`PLCResolver`](https://fastatp.com/api/plcresolver.md): DIDResolver for did:plc via a PLC directory. Resolve-only.

## `fastatp.did.resolver`

- [`ContinuityResolver`](https://fastatp.com/api/continuityresolver.md): Self-certifying did:web resolution.
- [`DIDResolver`](https://fastatp.com/api/didresolver.md)
- [`WebResolver`](https://fastatp.com/api/webresolver.md): Default DIDResolver for did:web over HTTPS.
- [`chain`](https://fastatp.com/api/chain.md): Compose resolvers: first non-None document wins.
- [`web_resolver`](https://fastatp.com/api/web-resolver.md): Module-level default resolver instance (shared cache).

## `fastatp.exceptions`

- [`CryptoError`](https://fastatp.com/api/cryptoerror.md): Key parsing, encoding, or signing failure.
- [`DIDDocumentInvalid`](https://fastatp.com/api/diddocumentinvalid.md): A document was found but is not a valid (atproto-shaped) DID document.
- [`DIDNotFound`](https://fastatp.com/api/didnotfound.md): No resolver could produce a document for the DID.
- [`DIDResolutionTimeout`](https://fastatp.com/api/didresolutiontimeout.md): Resolution did not complete within the configured timeout.
- [`FastATPError`](https://fastatp.com/api/fastatperror.md): Base class for all FastATP errors.
- [`HeadMoved`](https://fastatp.com/api/headmoved.md): The repo's head in its fastatp.repo.head.HeadStore is no longer the one this commit or import was built on: another process got there first. Nothing became visible. head is the current head, and the repo has already reloaded to it, so the caller re-reads and retries on the same object; Repo.apply_writes retries a few times by itself before letting this out. head is None when the store no longer holds a head for this DID at all (it was deleted): then there is nothing to reload, the repo object is stale, and the caller reopens or recreates the repo instead of retrying.
- [`LexiconError`](https://fastatp.com/api/lexiconerror.md): Base class for Lexicon schema errors.
- [`LexiconExportError`](https://fastatp.com/api/lexiconexporterror.md): A Pydantic construct has no Lexicon equivalent and cannot be exported.
- [`LexiconValidationError`](https://fastatp.com/api/lexiconvalidationerror.md): Record data does not conform to its Lexicon schema.
- [`NotAuthorized`](https://fastatp.com/api/notauthorized.md): The authorize() hook rejected the (issuer, nsid) pair.
- [`RepoError`](https://fastatp.com/api/repoerror.md): Base class for repository errors.
- [`SignatureInvalid`](https://fastatp.com/api/signatureinvalid.md): The signature does not verify against the resolved public key.
- [`SignerMismatch`](https://fastatp.com/api/signermismatch.md): The record's issuer does not match expected_signer.
- [`UnknownLexicon`](https://fastatp.com/api/unknownlexicon.md): The record's $type is not present in the Lexicon registry.
- [`VerificationError`](https://fastatp.com/api/verificationerror.md): Base class for signed-record verification failures.
- [`exceptions`](https://fastatp.com/api/exceptions.md): FastATP exception hierarchy.

## `fastatp.identity`

- [`Identity`](https://fastatp.com/api/identity.md): A bootstrapped identity: its DID, signing key, durable repo, and (for a did:web identity) its self-certifying continuity chain.

## `fastatp.lexicon`

- [`Lexicon`](https://fastatp.com/api/lexicon.md): Base class for user-defined, atproto-conforming record types.
- [`parse_record`](https://fastatp.com/api/parse-record.md): Dispatch a $type-carrying dict to its registered Lexicon class.

## `fastatp.peer`

- [`Peer`](https://fastatp.com/api/peer.md): Symmetric participant: a DID, optionally a signing key, a resolver.

## `fastatp.peerapp`

- [`Envelope`](https://fastatp.com/api/envelope.md): Verified context handed to every handler.
- [`PeerApp`](https://fastatp.com/api/peerapp.md): One DID's peer + PeerServer + reconciler, wrapped as a dispatch app.
- [`PrivateChannel`](https://fastatp.com/api/privatechannel.md): A live ephemeral private-response repo.

## `fastatp.repo.repo`

- [`Repo`](https://fastatp.com/api/repo.md): A DID's signed, present-state repository over a block store.
- [`WriteOp`](https://fastatp.com/api/writeop.md)

## `fastatp.repo.storage`

- [`MemoryStorage`](https://fastatp.com/api/memorystorage.md): Everything in process memory: ephemeral peers, tests.
- [`SqliteStorage`](https://fastatp.com/api/sqlitestorage.md): The built-in durable storage: a directory holding blocks.sqlite (blocks and heads, one file, so a consistent copy of it is the whole repo) and blobs.sqlite (created when first used). Several processes may open the same directory; sqlite serializes the writers and the head swap decides who wins.
- [`Storage`](https://fastatp.com/api/storage.md): Everything a peer's repos keep, in one database of the builder's choice.

## `fastatp.repo.sync`

- [`RepoMirror`](https://fastatp.com/api/repomirror.md): Verified follower of one producer's repo.

## `fastatp.server.did_server`

- [`DIDServer`](https://fastatp.com/api/didserver.md): Serves /.well-known/did.json (root DID, slug "") and /{slug}/did.json (path-segmented DIDs) from a caller-supplied resolver.

## `fastatp.server.peer_server`

- [`PeerServer`](https://fastatp.com/api/peerserver.md): Hosts a peer's repos; exposes the firehose and checkpoint routes.
- [`RepoHandle`](https://fastatp.com/api/repohandle.md): A write + admin handle to one hosted repo.
