OpenAgentID documentation
Source referencesTypeScript reference

@openagentid/aegis-sdk API

Exported TypeScript types, signatures and source documentation.

Package manifest, subpaths, and integration guide.

This reference resolves exported symbols from the package entry point with the TypeScript parser/type checker. It includes declarations and inferred types, not implementation bodies. External dependencies unavailable to the extraction environment can remain unresolved; this is source documentation, not proof that all packages typecheck or are published.

chainCoinType

BIP-44 coin type for the given chain.

export declare const chainCoinType: (chain: Chain) => number;

Source: aegis/sdks/typescript/src/core/types.ts:269.

derivationStandard

Returns the derivation standard name for the given chain.

export declare const derivationStandard: (chain: Chain) => "BIP-44" | "SLIP-0010";

Source: aegis/sdks/typescript/src/core/types.ts:294.

makePagination

export declare const makePagination: (limit: number, offset: number) => Pagination;

Source: aegis/sdks/typescript/src/core/types.ts:355.

IdentityType

The type of entity being authenticated.

// ---------------------------------------------------------------------------
// Authentication (§7)
// ---------------------------------------------------------------------------
/** The type of entity being authenticated. */
export type IdentityType = "human" | "agent" | "organization" | "enterprise" | "delegated";

Source: aegis/sdks/typescript/src/core/types.ts:16.

AegisIdentity

Identity information extracted from authentication.

/** Identity information extracted from authentication. */
export interface AegisIdentity {
    did: string;
    identityType: IdentityType;
    displayName?: string | null;
    conformanceLevel?: number | null;
}

Source: aegis/sdks/typescript/src/core/types.ts:24.

AuthContext

The output of successful authentication (AEGIS Spec §7.1).

/** The output of successful authentication (AEGIS Spec §7.1). */
export interface AuthContext {
    provider: string;
    subject: string;
    did?: string | null;
    sessionId?: string | null;
    expiresAt?: string | null; // ISO-8601 UTC
    claims: Record<string, unknown>;
}

Source: aegis/sdks/typescript/src/core/types.ts:32.

AuthCredential

Discriminated union of credentials accepted by AEGIS auth providers (§7.2).

/** Discriminated union of credentials accepted by AEGIS auth providers (§7.2). */
export type AuthCredential = {
    type: "bearer_token";
    token: string;
} | {
    type: "session_cookie";
    cookie: string;
} | {
    type: "api_key";
    key: string;
} | {
    type: "signed_challenge";
    did: string;
    challenge: string;
    signature: string;
    timestamp: string;
    nonce: string;
} | {
    type: "capability_token";
    token: string;
} | {
    type: "passkey_assertion";
    credentialId: string;
    authenticatorData: string;
    clientDataJson: string;
    signature: string;
} | {
    type: "custom";
    provider: string;
    data: unknown;
};

Source: aegis/sdks/typescript/src/core/types.ts:42.

Session

Session token structure (AEGIS Spec §7.4).

/** Session token structure (AEGIS Spec §7.4). */
export interface Session {
    sessionId: string;
    did: string;
    provider: string;
    createdAt: string; // ISO-8601 UTC
    expiresAt: string; // ISO-8601 UTC
    scope: string[];
    deviceBinding?: string | null;
}

Source: aegis/sdks/typescript/src/core/types.ts:65.

PolicyContext

// ---------------------------------------------------------------------------
// Policy (§8)
// ---------------------------------------------------------------------------
export interface PolicyContext {
    authContext?: AuthContext | null;
    lineage?: LineageSummary | null;
    conformanceLevel?: number | null;
    session?: Session | null;
    extra: Record<string, unknown>;
}

Source: aegis/sdks/typescript/src/core/types.ts:79.

LineageSummary

export interface LineageSummary {
    depth: number;
    humanRoot: string;
    verified: boolean;
}

Source: aegis/sdks/typescript/src/core/types.ts:87.

PolicyRequest

export interface PolicyRequest {
    principal: string;
    action: string;
    resource: string;
    context: PolicyContext;
}

Source: aegis/sdks/typescript/src/core/types.ts:93.

ObligationType

export type ObligationType = "log" | "notify" | "approve" | "escrow" | "limit";

Source: aegis/sdks/typescript/src/core/types.ts:100.

Obligation

export interface Obligation {
    obligationType: ObligationType;
    params: Record<string, unknown>;
    deadline?: string | null;
}

Source: aegis/sdks/typescript/src/core/types.ts:102.

AuditInfo

export interface AuditInfo {
    auditId: string;
    timestamp: string;
    engine: string;
    policiesEvaluated: string[];
}

Source: aegis/sdks/typescript/src/core/types.ts:108.

PolicyDecision

export interface PolicyDecision {
    allowed: boolean;
    reason?: string | null;
    obligations: Obligation[];
    auditInfo: AuditInfo;
}

Source: aegis/sdks/typescript/src/core/types.ts:115.

PermissionCheck

export interface PermissionCheck {
    principal: string;
    permission: string;
    resource?: string | null;
}

Source: aegis/sdks/typescript/src/core/types.ts:122.

RevocationStatus

// ---------------------------------------------------------------------------
// Verification (§5)
// ---------------------------------------------------------------------------
export type RevocationStatus = "active" | "revoked" | "suspended" | "expired" | "unknown";

Source: aegis/sdks/typescript/src/core/types.ts:132.

LivenessStatus

export type LivenessStatus = "active" | "warning" | "stale" | "unknown";

Source: aegis/sdks/typescript/src/core/types.ts:139.

VerificationResult

export interface VerificationResult {
    did: string;
    signatureValid: boolean;
    lineageValid: boolean;
    lineageDepth: number;
    humanRoot?: string | null;
    revocationStatus: RevocationStatus;
    livenessStatus: LivenessStatus;
    conformanceLevel: number;
    warnings: string[];
    verifiedAt: string;
}

Source: aegis/sdks/typescript/src/core/types.ts:141.

VerificationConfig

export interface VerificationConfig {
    maxLineageDepth: number;
    perHopTimeoutSecs: number;
    totalTimeoutSecs: number;
    cacheTtlSecs: number;
    livenessPeriodDays: number;
    conformanceLevel: number;
}

Source: aegis/sdks/typescript/src/core/types.ts:154.

DEFAULT_VERIFICATION_CONFIG

export declare const DEFAULT_VERIFICATION_CONFIG: VerificationConfig;

Source: aegis/sdks/typescript/src/core/types.ts:163.

ActiveHours

// ---------------------------------------------------------------------------
// Delegation (§9)
// ---------------------------------------------------------------------------
export interface ActiveHours {
    startHour: number;
    endHour: number;
    timezone: string;
}

Source: aegis/sdks/typescript/src/core/types.ts:176.

TemporalConstraints

export interface TemporalConstraints {
    validFrom?: string | null;
    validUntil?: string | null;
    activeHours?: ActiveHours | null;
    cooldown?: string | null; // ISO 8601 duration
}

Source: aegis/sdks/typescript/src/core/types.ts:182.

SpendingLimits

export interface SpendingLimits {
    maxAmount?: string | null;
    dailyVolume?: string | null;
    assetAllowlist: string[];
    recipientAllowlist: string[];
    approvalThreshold?: string | null;
}

Source: aegis/sdks/typescript/src/core/types.ts:189.

DelegationScope

export interface DelegationScope {
    actions: string[];
    resources: string[];
    chains: string[];
    limits?: SpendingLimits | null;
    temporal?: TemporalConstraints | null;
}

Source: aegis/sdks/typescript/src/core/types.ts:197.

DelegationProof

export interface DelegationProof {
    type: "AegisDelegationProof2025";
    verificationMethod: string;
    created: string;
    jws: string;
}

Source: aegis/sdks/typescript/src/core/types.ts:205.

Delegation

export interface Delegation {
    id: string;
    delegator: string;
    delegate: string;
    scope: DelegationScope;
    created: string;
    expires?: string | null;
    revocable: boolean;
    proof: DelegationProof;
}

Source: aegis/sdks/typescript/src/core/types.ts:212.

SessionKey

export interface SessionKey {
    sessionKey: string; // multibase-encoded ephemeral verifying key
    principal: string;
    scope: DelegationScope;
    maxTransactions?: number | null;
    created: string;
    expires: string;
    proof: DelegationProof;
}

Source: aegis/sdks/typescript/src/core/types.ts:223.

WalletType

// ---------------------------------------------------------------------------
// Wallet (§10)
// ---------------------------------------------------------------------------
export type WalletType = "eoa" | "smart" | "abstract";

Source: aegis/sdks/typescript/src/core/types.ts:237.

Chain

export type Chain = "ethereum" | "polygon" | "arbitrum" | "optimism" | "base" | "solana" | "bitcoin" | "cosmos" | "osmosis" | "aptos" | "sui" | "starknet";

Source: aegis/sdks/typescript/src/core/types.ts:239.

CHAIN_VALUES

export declare const CHAIN_VALUES: readonly Chain[];

Source: aegis/sdks/typescript/src/core/types.ts:253.

SigningMode

export type SigningMode = "direct" | "mpc" | "tee" | "external";

Source: aegis/sdks/typescript/src/core/types.ts:305.

BatchMode

export type BatchMode = "all_or_nothing" | "best_effort";

Source: aegis/sdks/typescript/src/core/types.ts:307.

KeyRole

// ---------------------------------------------------------------------------
// Key Management (§6)
// ---------------------------------------------------------------------------
export type KeyRole = "identity" | "authentication" | "assertion" | "delegation" | "session" | "recovery" | "chain";

Source: aegis/sdks/typescript/src/core/types.ts:313.

KeyGenerationMode

export type KeyGenerationMode = "direct" | "mpc" | "tee" | "hsm";

Source: aegis/sdks/typescript/src/core/types.ts:322.

ThresholdConfig

export interface ThresholdConfig {
    threshold: number;
    totalShares: number;
}

Source: aegis/sdks/typescript/src/core/types.ts:324.

GuardianType

export type GuardianType = "identity" | "email" | "phone" | "hardware";

Source: aegis/sdks/typescript/src/core/types.ts:329.

Guardian

export interface Guardian {
    guardianType: GuardianType;
    identifier: string;
    weight: number;
}

Source: aegis/sdks/typescript/src/core/types.ts:331.

RecoveryConfig

export interface RecoveryConfig {
    guardians: Guardian[];
    threshold: number;
    timelock: string; // ISO 8601 duration
}

Source: aegis/sdks/typescript/src/core/types.ts:337.

MAX_PAGE_SIZE

export declare const MAX_PAGE_SIZE: 1000;

Source: aegis/sdks/typescript/src/core/types.ts:347.

DEFAULT_PAGE_SIZE

export declare const DEFAULT_PAGE_SIZE: 100;

Source: aegis/sdks/typescript/src/core/types.ts:348.

Pagination

export interface Pagination {
    limit: number;
    offset: number;
}

Source: aegis/sdks/typescript/src/core/types.ts:350.

DEFAULT_PAGINATION

export declare const DEFAULT_PAGINATION: Pagination;

Source: aegis/sdks/typescript/src/core/types.ts:362.

IdentityTypeSchema

export declare const IdentityTypeSchema: z.ZodEnum<{ human: "human"; agent: "agent"; organization: "organization"; enterprise: "enterprise"; delegated: "delegated"; }>;

Source: aegis/sdks/typescript/src/core/types.ts:371.

ChainSchema

export declare const ChainSchema: z.ZodEnum<{ ethereum: "ethereum"; polygon: "polygon"; arbitrum: "arbitrum"; optimism: "optimism"; base: "base"; solana: "solana"; bitcoin: "bitcoin"; cosmos: "cosmos"; osmosis: "osmosis"; aptos: "aptos"; sui: "sui"; starknet: "starknet"; }>;

Source: aegis/sdks/typescript/src/core/types.ts:379.

KeyRoleSchema

export declare const KeyRoleSchema: z.ZodEnum<{ identity: "identity"; authentication: "authentication"; assertion: "assertion"; delegation: "delegation"; session: "session"; recovery: "recovery"; chain: "chain"; }>;

Source: aegis/sdks/typescript/src/core/types.ts:394.

SpendingLimitsSchema

export declare const SpendingLimitsSchema: z.ZodObject<{ maxAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>; dailyVolume: z.ZodOptional<z.ZodNullable<z.ZodString>>; assetAllowlist: z.ZodDefault<z.ZodArray<z.ZodString>>; recipientAllowlist: z.ZodDefault<z.ZodArray<z.ZodString>>; approvalThreshold: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>;

Source: aegis/sdks/typescript/src/core/types.ts:404.

ActiveHoursSchema

export declare const ActiveHoursSchema: z.ZodObject<{ startHour: z.ZodNumber; endHour: z.ZodNumber; timezone: z.ZodString; }, z.core.$strip>;

Source: aegis/sdks/typescript/src/core/types.ts:412.

TemporalConstraintsSchema

export declare const TemporalConstraintsSchema: z.ZodObject<{ validFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>; validUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>; activeHours: z.ZodOptional<z.ZodNullable<z.ZodObject<{ startHour: z.ZodNumber; endHour: z.ZodNumber; timezone: z.ZodString; }, z.core.$strip>>>; cooldown: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>;

Source: aegis/sdks/typescript/src/core/types.ts:418.

DelegationScopeSchema

export declare const DelegationScopeSchema: z.ZodObject<{ actions: z.ZodDefault<z.ZodArray<z.ZodString>>; resources: z.ZodDefault<z.ZodArray<z.ZodString>>; chains: z.ZodDefault<z.ZodArray<z.ZodString>>; limits: z.ZodOptional<z.ZodNullable<z.ZodObject<{ maxAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>; dailyVolume: z.ZodOptional<z.ZodNullable<z.ZodString>>; assetAllowlist: z.ZodDefault<z.ZodArray<z.ZodString>>; recipientAllowlist: z.ZodDefault<z.ZodArray<z.ZodString>>; approvalThreshold: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>>>; temporal: z.ZodOptional<z.ZodNullable<z.ZodObject<{ validFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>; validUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>; activeHours: z.ZodOptional<z.ZodNullable<z.ZodObject<{ startHour: z.ZodNumber; endHour: z.ZodNumber; timezone: z.ZodString; }, z.core.$strip>>>; cooldown: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>>>; }, z.core.$strip>;

Source: aegis/sdks/typescript/src/core/types.ts:425.

DelegationProofSchema

export declare const DelegationProofSchema: z.ZodObject<{ type: z.ZodLiteral<"AegisDelegationProof2025">; verificationMethod: z.ZodString; created: z.ZodString; jws: z.ZodString; }, z.core.$strip>;

Source: aegis/sdks/typescript/src/core/types.ts:433.

DelegationSchema

export declare const DelegationSchema: z.ZodObject<{ id: z.ZodString; delegator: z.ZodString; delegate: z.ZodString; scope: z.ZodObject<{ actions: z.ZodDefault<z.ZodArray<z.ZodString>>; resources: z.ZodDefault<z.ZodArray<z.ZodString>>; chains: z.ZodDefault<z.ZodArray<z.ZodString>>; limits: z.ZodOptional<z.ZodNullable<z.ZodObject<{ maxAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>; dailyVolume: z.ZodOptional<z.ZodNullable<z.ZodString>>; assetAllowlist: z.ZodDefault<z.ZodArray<z.ZodString>>; recipientAllowlist: z.ZodDefault<z.ZodArray<z.ZodString>>; approvalThreshold: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>>>; temporal: z.ZodOptional<z.ZodNullable<z.ZodObject<{ validFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>; validUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>; activeHours: z.ZodOptional<z.ZodNullable<z.ZodObject<{ startHour: z.ZodNumber; endHour: z.ZodNumber; timezone: z.ZodString; }, z.core.$strip>>>; cooldown: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>>>; }, z.core.$strip>; created: z.ZodString; expires: z.ZodOptional<z.ZodNullable<z.ZodString>>; revocable: z.ZodBoolean; proof: z.ZodObject<{ type: z.ZodLiteral<"AegisDelegationProof2025">; verificationMethod: z.ZodString; created: z.ZodString; jws: z.ZodString; }, z.core.$strip>; }, z.core.$strip>;

Source: aegis/sdks/typescript/src/core/types.ts:440.

ResolverError

// AEGIS Core — Tagged Errors
//
// Each AEGIS layer defines its own error variants. We use a discriminated
// union of "error tags" rather than throwing untagged Error subclasses, so
// callers can pattern-match safely on the `kind` field.
export type ResolverError = {
    kind: "resolver/not_found";
    did: string;
    message: string;
} | {
    kind: "resolver/invalid_format";
    reason: string;
    message: string;
} | {
    kind: "resolver/timeout";
    did: string;
    timeoutMs: number;
    message: string;
} | {
    kind: "resolver/deactivated";
    did: string;
    message: string;
} | {
    kind: "resolver/network";
    did: string;
    reason: string;
    message: string;
} | {
    kind: "resolver/creation_not_supported";
    message: string;
} | {
    kind: "resolver/update_not_supported";
    message: string;
} | {
    kind: "resolver/deactivation_not_supported";
    message: string;
};

Source: aegis/sdks/typescript/src/core/errors.ts:7.

AuthError

export type AuthError = {
    kind: "auth/invalid_credential";
    reason: string;
    message: string;
} | {
    kind: "auth/credential_expired";
    expiredAt: string;
    message: string;
} | {
    kind: "auth/session_revoked";
    sessionId: string;
    message: string;
} | {
    kind: "auth/session_expired";
    sessionId: string;
    message: string;
} | {
    kind: "auth/challenge_invalid";
    reason: string;
    message: string;
} | {
    kind: "auth/provider_unavailable";
    provider: string;
    message: string;
} | {
    kind: "auth/refresh_not_supported";
    provider: string;
    message: string;
} | {
    kind: "auth/revocation_not_supported";
    provider: string;
    message: string;
} | {
    kind: "auth/internal";
    reason: string;
    message: string;
};

Source: aegis/sdks/typescript/src/core/errors.ts:27.

PolicyError

export type PolicyError = {
    kind: "policy/evaluation_failed";
    reason: string;
    message: string;
} | {
    kind: "policy/timeout";
    timeoutMs: number;
    message: string;
} | {
    kind: "policy/engine_unavailable";
    message: string;
} | {
    kind: "policy/no_engine";
    message: string;
} | {
    kind: "policy/config_error";
    reason: string;
    message: string;
};

Source: aegis/sdks/typescript/src/core/errors.ts:42.

VerificationError

export type VerificationError = {
    kind: "verify/resolution_failed";
    did: string;
    reason: string;
    message: string;
} | {
    kind: "verify/invalid_schema";
    did: string;
    reason: string;
    message: string;
} | {
    kind: "verify/invalid_signature";
    did: string;
    message: string;
} | {
    kind: "verify/lineage_failed";
    did: string;
    reason: string;
    message: string;
} | {
    kind: "verify/max_depth_exceeded";
    did: string;
    depth: number;
    maxDepth: number;
    message: string;
} | {
    kind: "verify/revoked";
    did: string;
    message: string;
} | {
    kind: "verify/suspended";
    did: string;
    message: string;
} | {
    kind: "verify/human_root_revoked";
    humanRoot: string;
    message: string;
} | {
    kind: "verify/generation_mismatch";
    did: string;
    expected: number;
    found: number;
    message: string;
} | {
    kind: "verify/timeout";
    did: string;
    message: string;
} | {
    kind: "verify/consistency_violation";
    did: string;
    reason: string;
    message: string;
};

Source: aegis/sdks/typescript/src/core/errors.ts:49.

KeyError

export type KeyError = {
    kind: "key/generation_failed";
    reason: string;
    message: string;
} | {
    kind: "key/derivation_failed";
    reason: string;
    message: string;
} | {
    kind: "key/rotation_failed";
    reason: string;
    message: string;
} | {
    kind: "key/recovery_failed";
    reason: string;
    message: string;
} | {
    kind: "key/mpc_failed";
    reason: string;
    message: string;
} | {
    kind: "key/not_found";
    keyId: string;
    message: string;
} | {
    kind: "key/storage_error";
    reason: string;
    message: string;
} | {
    kind: "key/signing_failed";
    reason: string;
    message: string;
} | {
    kind: "key/unsupported_type";
    keyType: string;
    message: string;
};

Source: aegis/sdks/typescript/src/core/errors.ts:94.

DelegationError

export type DelegationError = {
    kind: "delegation/invalid_proof";
    reason: string;
    message: string;
} | {
    kind: "delegation/revoked";
    delegationId: string;
    message: string;
} | {
    kind: "delegation/expired";
    delegationId: string;
    message: string;
} | {
    kind: "delegation/max_depth_exceeded";
    depth: number;
    maxDepth: number;
    message: string;
} | {
    kind: "delegation/scope_amplification";
    reason: string;
    message: string;
} | {
    kind: "delegation/delegator_not_found";
    did: string;
    message: string;
} | {
    kind: "delegation/delegate_not_found";
    did: string;
    message: string;
};

Source: aegis/sdks/typescript/src/core/errors.ts:105.

WalletError

export type WalletError = {
    kind: "wallet/authorization_failed";
    reason: string;
    message: string;
} | {
    kind: "wallet/signing_failed";
    reason: string;
    message: string;
} | {
    kind: "wallet/unsupported_chain";
    chain: string;
    message: string;
} | {
    kind: "wallet/derivation_failed";
    chain: string;
    reason: string;
    message: string;
} | {
    kind: "wallet/policy_denied";
    reason: string;
    message: string;
} | {
    kind: "wallet/obligation_failed";
    reason: string;
    message: string;
} | {
    kind: "wallet/batch_partial_failure";
    succeeded: number;
    total: number;
    message: string;
};

Source: aegis/sdks/typescript/src/core/errors.ts:119.

AegisError

export type AegisError = ResolverError | AuthError | PolicyError | VerificationError | KeyError | DelegationError | WalletError;

Source: aegis/sdks/typescript/src/core/errors.ts:138.

AegisException

Throwable wrapper around a tagged AegisError.

export declare class AegisException {
  error: AegisError;
  constructor(error: AegisError): AegisException;
}

Source: aegis/sdks/typescript/src/core/errors.ts:148.

resolverErrors

export declare const resolverErrors: { notFound: (did: string) => ResolverError; invalidFormat: (reason: string) => ResolverError; timeout: (did: string, timeoutMs: number) => ResolverError; deactivated: (did: string) => ResolverError; network: (did: string, reason: string) => ResolverError; creationNotSupported: () => ResolverError; updateNotSupported: () => ResolverError; deactivationNotSupported: () => ResolverError; };

Source: aegis/sdks/typescript/src/core/errors.ts:160.

authErrors

export declare const authErrors: { invalidCredential: (reason: string) => AuthError; credentialExpired: (expiredAt: string) => AuthError; sessionRevoked: (sessionId: string) => AuthError; sessionExpired: (sessionId: string) => AuthError; challengeInvalid: (reason: string) => AuthError; providerUnavailable: (provider: string) => AuthError; refreshNotSupported: (provider: string) => AuthError; revocationNotSupported: (provider: string) => AuthError; internal: (reason: string) => AuthError; };

Source: aegis/sdks/typescript/src/core/errors.ts:202.

policyErrors

export declare const policyErrors: { evaluationFailed: (reason: string) => PolicyError; timeout: (timeoutMs: number) => PolicyError; engineUnavailable: () => PolicyError; noEngine: () => PolicyError; configError: (reason: string) => PolicyError; };

Source: aegis/sdks/typescript/src/core/errors.ts:250.

verificationErrors

export declare const verificationErrors: { resolutionFailed: (did: string, reason: string) => VerificationError; invalidSchema: (did: string, reason: string) => VerificationError; invalidSignature: (did: string) => VerificationError; lineageFailed: (did: string, reason: string) => VerificationError; maxDepthExceeded: (did: string, depth: number, maxDepth: number) => VerificationError; revoked: (did: string) => VerificationError; suspended: (did: string) => VerificationError; humanRootRevoked: (humanRoot: string) => VerificationError; timeout: (did: string) => VerificationError; };

Source: aegis/sdks/typescript/src/core/errors.ts:276.

keyErrors

export declare const keyErrors: { generationFailed: (reason: string) => KeyError; derivationFailed: (reason: string) => KeyError; rotationFailed: (reason: string) => KeyError; recoveryFailed: (reason: string) => KeyError; mpcFailed: (reason: string) => KeyError; notFound: (keyId: string) => KeyError; storageError: (reason: string) => KeyError; signingFailed: (reason: string) => KeyError; unsupportedKeyType: (keyType: string) => KeyError; };

Source: aegis/sdks/typescript/src/core/errors.ts:333.

delegationErrors

export declare const delegationErrors: { invalidProof: (reason: string) => DelegationError; revoked: (delegationId: string) => DelegationError; expired: (delegationId: string) => DelegationError; maxDepthExceeded: (depth: number, maxDepth: number) => DelegationError; scopeAmplification: (reason: string) => DelegationError; delegatorNotFound: (did: string) => DelegationError; delegateNotFound: (did: string) => DelegationError; };

Source: aegis/sdks/typescript/src/core/errors.ts:381.

walletErrors

export declare const walletErrors: { authorizationFailed: (reason: string) => WalletError; signingFailed: (reason: string) => WalletError; unsupportedChain: (chain: string) => WalletError; derivationFailed: (chain: string, reason: string) => WalletError; policyDenied: (reason: string) => WalletError; obligationFailed: (reason: string) => WalletError; batchPartialFailure: (succeeded: number, total: number) => WalletError; };

Source: aegis/sdks/typescript/src/core/errors.ts:420.

inferIdentityTypeFromDid

Infer the IdentityType from a did:oas:&lt;ns>:&lt;kind>:&lt;id> string.

Returns "agent" if the DID cannot be parsed.

export declare const inferIdentityTypeFromDid: (did: string) => "human" | "organization" | "enterprise" | "agent";

Source: aegis/sdks/typescript/src/core/oas.ts:113.

LifecycleStatus

// AEGIS Core — OAS Document Interfaces
//
// AEGIS-TS does not vendor the OAS TypeScript SDK directly. Instead, it
// declares the minimal subset of OAS types it needs (DidDocument shape,
// LineageSection, VerificationMethod, lifecycle status, etc.) and accepts
// any object satisfying these interfaces. Adapters in @oas/document or
// custom implementations can supply documents that match.
//
// Reference: oas/oas/docs/oas/SPECIFICATION.md v1.1.0
export type LifecycleStatus = "active" | "suspended" | "terminated" | "deprecated" | "draft";

Source: aegis/sdks/typescript/src/core/oas.ts:11.

EntityKind

export type EntityKind = "hmr" | "mhr" | "enr" | "ao" | "agent" | "agent:instance" | "tool" | "skill" | "workflow" | "model" | "dataset" | "service";

Source: aegis/sdks/typescript/src/core/oas.ts:18.

VerificationMethod

Verification method per W3C DID-Core.

/** Verification method per W3C DID-Core. */
export interface VerificationMethod {
    id: string;
    type: string;
    controller: string;
    publicKeyMultibase: string;
}

Source: aegis/sdks/typescript/src/core/oas.ts:33.

LineageSection

Optional lineage section for non-root entities.

/** Optional lineage section for non-root entities. */
export interface LineageSection {
    parent: string;
    generation: number;
    humanRootChain: string[];
    proof?: AgentLineageProof | null;
}

Source: aegis/sdks/typescript/src/core/oas.ts:41.

AgentLineageProof

export interface AgentLineageProof {
    type: string; // "AgentLineageProof2025"
    verificationMethod: string;
    created: string;
    jws: string;
}

Source: aegis/sdks/typescript/src/core/oas.ts:48.

DocumentMetadata

export interface DocumentMetadata {
    created: string;
    updated?: string | null;
}

Source: aegis/sdks/typescript/src/core/oas.ts:55.

DocumentProof

export interface DocumentProof {
    type: string; // e.g. "Ed25519Signature2020"
    verificationMethod: string;
    created: string;
    jws?: string;
    proofValue?: string;
}

Source: aegis/sdks/typescript/src/core/oas.ts:60.

OasDocument

Minimal OAS Identity Document interface.

/** Minimal OAS Identity Document interface. */
export interface OasDocument {
    id: string;
    oasVersion: string;
    kind: string;
    verificationMethod: VerificationMethod[];
    authentication?: string[];
    assertionMethod?: string[];
    delegationMethod?: string[];
    metadata: DocumentMetadata;
    lineage?: LineageSection | null;
    lifecycleStatus?: LifecycleStatus | null;
    revoked?: boolean;
    proof?: DocumentProof | null;
    // Allow additional fields without complaining.
    [key: string]: unknown;
}

Source: aegis/sdks/typescript/src/core/oas.ts:69.

oasDocument

Helpers for inspecting OAS documents without coupling to a specific SDK.

export declare const oasDocument: { isRoot(doc: OasDocument): boolean; isRevoked(doc: OasDocument): boolean; primaryPublicKeyMultibase(doc: OasDocument): string | null; findVerificationMethod(doc: OasDocument, id: string): VerificationMethod | null; };

Source: aegis/sdks/typescript/src/core/oas.ts:87.

CreateDidParams

// ---------------------------------------------------------------------------
// DID Resolver Interface (§4.1)
// ---------------------------------------------------------------------------
export interface CreateDidParams {
    entityKind: string;
    namespace: string;
    identifier: string;
    metadata: Record<string, string>;
}

Source: aegis/sdks/typescript/src/core/plugin.ts:30.

DidCreationResult

export interface DidCreationResult {
    did: string;
    document: OasDocument;
}

Source: aegis/sdks/typescript/src/core/plugin.ts:37.

DidResolver

DID Resolver plugin interface (§4.1).

Enables AEGIS to resolve any DID method without coupling to a specific resolution mechanism. Each resolver handles one or more DID methods.

Implementations MUST resolve within 5 seconds.

/**
 * DID Resolver plugin interface (§4.1).
 *
 * Enables AEGIS to resolve any DID method without coupling to a specific
 * resolution mechanism. Each resolver handles one or more DID methods.
 *
 * Implementations MUST resolve within 5 seconds.
 */
export interface DidResolver {
    resolve(did: string): Promise<OasDocument>;
    handles(did: string): boolean;
    supportedMethods(): readonly string[];
    create?(params: CreateDidParams): Promise<DidCreationResult>;
    update?(did: string, document: OasDocument): Promise<void>;
    deactivate?(did: string): Promise<void>;
}

Source: aegis/sdks/typescript/src/core/plugin.ts:50.

AuthProvider

// ---------------------------------------------------------------------------
// Auth Provider Interface (§4.2)
// ---------------------------------------------------------------------------
export interface AuthProvider {
    validate(credential: AuthCredential): Promise<AuthContext>;
    getIdentity(ctx: AuthContext): Promise<AegisIdentity>;
    providerName(): string;
    refresh?(ctx: AuthContext): Promise<AuthContext>;
    revoke?(ctx: AuthContext): Promise<void>;
}

Source: aegis/sdks/typescript/src/core/plugin.ts:63.

PolicyEngine

// ---------------------------------------------------------------------------
// Policy Engine Interface (§4.3)
// ---------------------------------------------------------------------------
export interface PolicyEngine {
    evaluate(request: PolicyRequest): Promise<PolicyDecision>;
    checkPermission(check: PermissionCheck): Promise<boolean>;
    engineName(): string;
    getPolicies?(did: string): Promise<unknown[]>;
}

Source: aegis/sdks/typescript/src/core/plugin.ts:75.

PluginRegistry

The Plugin Registry manages all loaded plugins and routes requests to the appropriate plugin (AEGIS Spec §4.4).

  • Multiple DID Resolvers (routed by handles() matching)
  • Multiple Auth Providers (keyed by providerName())
  • Exactly one Policy Engine

Plugin registration order is deterministic. Resolvers are tried in registration order; the first whose handles() returns true is used.

export declare class PluginRegistry {
  registerResolver(resolver: DidResolver): void;
  registerAuthProvider(provider: AuthProvider): void;
  setPolicyEngine(engine: PolicyEngine): void;
  resolverCount(): number;
  authProviderCount(): number;
  hasPolicyEngine(): boolean;
  getResolverFor(did: string): DidResolver | null;
  getAuthProvider(name: string): AuthProvider | null;
  getPolicyEngine(): PolicyEngine | null;
  resolveDid(did: string): Promise<OasDocument>;
  validateCredential(credential: AuthCredential, providerName?: string | null): Promise<AuthContext>;
  evaluatePolicy(request: PolicyRequest): Promise<PolicyDecision>;
  checkPermission(check: PermissionCheck): Promise<boolean>;
}

Source: aegis/sdks/typescript/src/core/plugin.ts:97.

setCryptoBackend

Inject a custom crypto backend implementation. Call this once at SDK initialization (typically with the @openagentid/crypto-wasm exports).

export declare const setCryptoBackend: (impl: CryptoBackend) => void;

Source: aegis/sdks/typescript/src/core/wasm.ts:106.

cryptoBackend

Returns the active crypto backend. Throws if none has been registered.

In Node.js, the backend can be auto-loaded by loadDefaultCryptoBackend which dynamically imports @openagentid/crypto-wasm.

export declare const cryptoBackend: () => CryptoBackend;

Source: aegis/sdks/typescript/src/core/wasm.ts:116.

loadDefaultCryptoBackend

Attempts to load @openagentid/crypto-wasm lazily. Falls back to a stub error backend if the module isn't available — callers should rely on this for one-time setup in tests/examples.

export declare const loadDefaultCryptoBackend: () => Promise<void>;

Source: aegis/sdks/typescript/src/core/wasm.ts:131.

CryptoBackend

// AEGIS Core — WASM Crypto Bridge
//
// AEGIS-TS delegates all primitive cryptographic operations to a single
// audited Rust implementation compiled to WebAssembly via wasm-pack. The
// canonical package is `@openagentid/crypto-wasm`. We import its named
// exports lazily so that the rest of the SDK works in environments where
// the WASM module is loaded asynchronously (Workers, Deno, etc.).
//
// The contract below is the API surface AEGIS depends on. The actual
// `@openagentid/crypto-wasm` package is built in parallel; until it ships,
// callers can inject a custom implementation via `setCryptoBackend()`.
//
// All byte parameters use Uint8Array. All return types are Uint8Array
// except for canonicalize which returns Uint8Array (UTF-8 of canonical
// JSON) and hash functions which return raw bytes.
export interface CryptoBackend {
    // -- Ed25519 --
    ed25519GenerateKeypair(): {
        signingKey: Uint8Array;
        verifyingKey: Uint8Array;
    };
    ed25519PublicFromPrivate(signingKey: Uint8Array): Uint8Array;
    ed25519Sign(signingKey: Uint8Array, message: Uint8Array): Uint8Array;
    ed25519Verify(verifyingKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
    // -- HKDF-SHA256 --
    hkdfSha256(ikm: Uint8Array, salt: Uint8Array, info: Uint8Array, length: number): Uint8Array;
    // -- BLAKE3 --
    blake3Hash(input: Uint8Array): Uint8Array;
    // -- SHA --
    sha256(input: Uint8Array): Uint8Array;
    sha512(input: Uint8Array): Uint8Array;
    // -- AES-256-GCM --
    aes256GcmEncrypt(key: Uint8Array, nonce: Uint8Array, plaintext: Uint8Array): Uint8Array;
    aes256GcmDecrypt(key: Uint8Array, nonce: Uint8Array, ciphertext: Uint8Array): Uint8Array;
    // -- JCS --
    jcsCanonicalize(value: unknown): Uint8Array;
    // -- Multibase base58btc --
    multibaseEncode(bytes: Uint8Array): string;
    multibaseDecode(encoded: string): Uint8Array;
    // -- Random bytes (CSPRNG) --
    randomBytes(length: number): Uint8Array;
    // -- FROST-Ed25519 (raw protocol primitives) --
    frostTrustedKeygen(minSigners: number, maxSigners: number): {
        keyPackages: FrostKeyPackage[];
        publicKeyPackage: Uint8Array;
    };
    frostSignRound1(signingShare: Uint8Array): {
        nonces: Uint8Array;
        commitments: Uint8Array;
    };
    frostSignRound2(signingPackage: Uint8Array, nonces: Uint8Array, keyPackage: Uint8Array): Uint8Array;
    frostBuildSigningPackage(commitments: Map<number, Uint8Array>, message: Uint8Array): Uint8Array;
    frostAggregate(signingPackage: Uint8Array, signatureShares: Map<number, Uint8Array>, publicKeyPackage: Uint8Array): Uint8Array;
    frostVerify(publicKeyPackage: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
}

Source: aegis/sdks/typescript/src/core/wasm.ts:17.

FrostKeyPackage

export interface FrostKeyPackage {
    identifier: number; // 1..max_signers
    bytes: Uint8Array;
}

Source: aegis/sdks/typescript/src/core/wasm.ts:95.

base64UrlEncode

Encode bytes as URL-safe base64 without padding.

export declare const base64UrlEncode: (bytes: Uint8Array) => string;

Source: aegis/sdks/typescript/src/core/encoding.ts:11.

base64UrlDecode

Decode a URL-safe base64 string (with or without padding) to bytes.

export declare const base64UrlDecode: (input: string) => Uint8Array;

Source: aegis/sdks/typescript/src/core/encoding.ts:50.

hexEncode

export declare const hexEncode: (bytes: Uint8Array) => string;

Source: aegis/sdks/typescript/src/core/encoding.ts:97.

hexDecode

export declare const hexDecode: (input: string) => Uint8Array;

Source: aegis/sdks/typescript/src/core/encoding.ts:105.

utf8Encode

export declare const utf8Encode: (s: string) => Uint8Array;

Source: aegis/sdks/typescript/src/core/encoding.ts:127.

utf8Decode

export declare const utf8Decode: (bytes: Uint8Array) => string;

Source: aegis/sdks/typescript/src/core/encoding.ts:131.

concatBytes

export declare const concatBytes: (...chunks: Uint8Array[]) => Uint8Array;

Source: aegis/sdks/typescript/src/core/encoding.ts:135.

u32BeBytes

big-endian u32 → 4 bytes

export declare const u32BeBytes: (n: number) => Uint8Array;

Source: aegis/sdks/typescript/src/core/encoding.ts:148.

VerificationPipeline

The AEGIS Verification Pipeline.

Performs complete verification of OAS identity documents per AEGIS Specification §5. Results are cached with a configurable TTL (max 300 seconds per spec).

export declare class VerificationPipeline {
  constructor(registry: PluginRegistry, config?: VerificationConfig): VerificationPipeline;
  cache(): VerificationCache;
  verify(did: string): Promise<VerificationResult>;
  verifyForceRefresh(did: string): Promise<VerificationResult>;
}

Source: aegis/sdks/typescript/src/verify/pipeline.ts:49.

VerificationCache

export declare class VerificationCache {
  constructor(ttlSecs: number): VerificationCache;
  ttl(): number;
  size(): number;
  isEmpty(): boolean;
  get(did: string): VerificationResult | null;
  insert(did: string, result: VerificationResult): void;
  invalidate(did: string): void;
  clear(): void;
  cleanupExpired(): number;
}

Source: aegis/sdks/typescript/src/verify/cache.ts:18.

VerificationCacheStore

export interface VerificationCacheStore {
    getCached(did: string): Promise<VerificationResult | null>;
    storeCached(did: string, result: VerificationResult): Promise<void>;
    invalidate(did: string): Promise<void>;
    cleanupExpired(): Promise<number>;
}

Source: aegis/sdks/typescript/src/verify/store.ts:9.

InMemoryVerificationCacheStore

export declare class InMemoryVerificationCacheStore {
  constructor(ttlSecs: number): InMemoryVerificationCacheStore;
  ttlSecs(): number;
  getCached(did: string): Promise<VerificationResult | null>;
  storeCached(did: string, result: VerificationResult): Promise<void>;
  invalidate(did: string): Promise<void>;
  cleanupExpired(): Promise<number>;
}

Source: aegis/sdks/typescript/src/verify/store.ts:24.

deriveLineageKey

Derive a lineage key from a parent private key using HKDF-SHA256.

Algorithm: HKDF-SHA256( IKM = parent_private_key (32 bytes), Salt = child_did_utf8, Info = "oas-lineage-v1" || generation_be32, L = 32 )

export declare const deriveLineageKey: (parentPrivate: Uint8Array, childDid: string, generation: number) => Uint8Array;

Source: aegis/sdks/typescript/src/keys/derivation.ts:28.

derivationPath

Build a BIP-44 derivation path for a given blockchain chain.

Returns the standard m/44'/coin_type'/account'/0/index path used for HD key derivation across most chains.

export declare const derivationPath: (chain: Chain, account: number, index: number) => string;

Source: aegis/sdks/typescript/src/keys/derivation.ts:58.

EncryptedKey

An encrypted private key blob.

Uses AES-256-GCM with a random 96-bit nonce. The ciphertext contains the 32-byte Ed25519 signing key material plus a 16-byte authentication tag.

export declare class EncryptedKey {
  ciphertext: Uint8Array;
  nonce: Uint8Array;
  encrypt(signingKeyBytes: Uint8Array, encryptionKey: Uint8Array): EncryptedKey;
  decrypt(encryptionKey: Uint8Array): Uint8Array;
  fromParts(ciphertext: Uint8Array, nonce: Uint8Array): EncryptedKey;
}

Source: aegis/sdks/typescript/src/keys/generation.ts:25.

ManagedKey

A managed key with metadata. The private key is stored encrypted; access to the raw signing key requires presenting the encryption key.

export declare class ManagedKey {
  keyId: string;
  role: KeyRole;
  generationMode: KeyGenerationMode;
  publicKey: Uint8Array;
  encryptedPrivate: EncryptedKey;
  createdAt: string;
  constructor(params: { keyId: string; role: KeyRole; generationMode: KeyGenerationMode; publicKey: Uint8Array; encryptedPrivate: EncryptedKey; createdAt: string; }): ManagedKey;
  publicKeyMultibase(): string;
  decryptPrivate(encryptionKey: Uint8Array): Uint8Array;
}

Source: aegis/sdks/typescript/src/keys/generation.ts:100.

KeyGenerator

Key generator supporting multiple generation modes (§6.2).

Currently implements direct generation via the WASM backend's CSPRNG. MPC, TEE, and HSM modes are stubs that throw an unsupported error.

export declare class KeyGenerator {
  generateDirect(role: KeyRole, encryptionKey: Uint8Array): ManagedKey;
  generateKeyId(): string;
}

Source: aegis/sdks/typescript/src/keys/generation.ts:142.

isRotationEligible

Convenience function: returns true if the role is eligible for standard rotation. Session and Recovery keys are excluded.

export declare const isRotationEligible: (role: KeyRole) => boolean;

Source: aegis/sdks/typescript/src/keys/rotation.ts:64.

RotationRequest

export interface RotationRequest {
    keyId: string;
    /** Grace period in milliseconds. */
    gracePeriodMs: number;
}

Source: aegis/sdks/typescript/src/keys/rotation.ts:15.

RotationResult

export interface RotationResult {
    oldKeyId: string;
    newKey: ManagedKey;
    /** ISO-8601 timestamp at which the grace period ends. */
    gracePeriodEnds: string;
}

Source: aegis/sdks/typescript/src/keys/rotation.ts:21.

KeyRotation

export declare class KeyRotation {
  initiate(old: ManagedKey, encryptionKey: Uint8Array): RotationResult;
  initiateWithGrace(old: ManagedKey, encryptionKey: Uint8Array, gracePeriodMs: number): RotationResult;
  isGracePeriodExpired(result: RotationResult): boolean;
}

Source: aegis/sdks/typescript/src/keys/rotation.ts:28.

parseIso8601DurationMs

Parse a simplified ISO 8601 duration into milliseconds.

Supports PT&#123;n&#125;S, PT&#123;n&#125;M, PT&#123;n&#125;H, and P&#123;n&#125;D. Falls back to 24 hours for unrecognized formats.

export declare const parseIso8601DurationMs: (input: string) => number;

Source: aegis/sdks/typescript/src/keys/recovery.ts:85.

GuardianAuthorization

export interface GuardianAuthorization {
    guardian: Guardian;
    authorizedAt: string; // ISO-8601 UTC
    signature: string;
}

Source: aegis/sdks/typescript/src/keys/recovery.ts:14.

RecoveryCeremony

export declare class RecoveryCeremony {
  ceremonyId: string;
  config: RecoveryConfig;
  authorizations: GuardianAuthorization[];
  initiatedAt: string;
  timelockUntil: string;
  constructor(config: RecoveryConfig): RecoveryCeremony;
  addAuthorization(auth: GuardianAuthorization): void;
  isThresholdMet(): boolean;
  isTimelockExpired(): boolean;
  canExecute(): boolean;
  accumulatedWeight(): number;
  authorizationCount(): number;
}

Source: aegis/sdks/typescript/src/keys/recovery.ts:20.

KeyStore

export interface KeyStore {
    store(key: ManagedKey): Promise<void>;
    load(keyId: string): Promise<ManagedKey>;
    delete(keyId: string): Promise<void>;
    list(role: KeyRole | null, pagination?: Pagination): Promise<string[]>;
}

Source: aegis/sdks/typescript/src/keys/storage.ts:15.

InMemoryKeyStore

export declare class InMemoryKeyStore {
  size(): number;
  isEmpty(): boolean;
  store(key: ManagedKey): Promise<void>;
  load(keyId: string): Promise<ManagedKey>;
  delete(keyId: string): Promise<void>;
  list(role: KeyRole | null, pagination?: Pagination): Promise<string[]>;
}

Source: aegis/sdks/typescript/src/keys/storage.ts:26.

generateShares

Generate threshold key shares using FROST trusted dealer.

Creates a t-of-n setup: any minSigners of maxSigners participants may cooperate to produce a valid signature. The dealer is trusted to destroy its copy of the master secret after distribution.

export declare const generateShares: (minSigners: number, maxSigners: number) => ThresholdKeyPackages;

Source: aegis/sdks/typescript/src/keys/threshold.ts:29.

signWithThreshold

Run a complete FROST signing round in a single process.

In production, each participant would perform round1 and round2 independently. This helper executes the full 2-round protocol locally for testing, validation, and single-process orchestration scenarios.

export declare const signWithThreshold: (message: Uint8Array, keyPackages: Map<number, Uint8Array>, publicKeyPackage: Uint8Array) => Uint8Array;

Source: aegis/sdks/typescript/src/keys/threshold.ts:73.

verifyThresholdSignature

Verify an aggregated FROST signature against the group public key.

export declare const verifyThresholdSignature: (message: Uint8Array, signature: Uint8Array, publicKeyPackage: Uint8Array) => boolean;

Source: aegis/sdks/typescript/src/keys/threshold.ts:136.

ThresholdKeyPackages

Result of FROST trusted-dealer key generation.

/** Result of FROST trusted-dealer key generation. */
export interface ThresholdKeyPackages {
    /** Per-participant key packages, indexed by FROST identifier (1..n). */
    keyPackages: Map<number, Uint8Array>;
    /** The serialized group public key package. */
    publicKeyPackage: Uint8Array;
}

Source: aegis/sdks/typescript/src/keys/threshold.ts:15.

FrostCeremony

State of a distributed FROST signing ceremony, suitable for orchestrating the protocol across multiple machines/processes. Each participant calls the methods in order:

  1. addCommitment(id, commitments) — gather round 1 outputs
  2. buildSigningPackage(message) — build signing package once all participants have committed
  3. addSignatureShare(id, share) — gather round 2 outputs
  4. aggregate() — produce the final aggregated signature

The ceremony does NOT hold any participant key material — those remain on the participant's own machine.

export declare class FrostCeremony {
  constructor(publicKeyPackage: Uint8Array, threshold: number): FrostCeremony;
  addCommitment(id: number, commitments: Uint8Array): void;
  hasEnoughCommitments(): boolean;
  buildSigningPackage(message: Uint8Array): Uint8Array;
  addSignatureShare(id: number, share: Uint8Array): void;
  hasEnoughShares(): boolean;
  aggregate(): Uint8Array;
}

Source: aegis/sdks/typescript/src/keys/threshold.ts:165.

generateChallenge

Generate a new random challenge.

export declare const generateChallenge: () => Challenge;

Source: aegis/sdks/typescript/src/auth/challenge.ts:31.

buildChallengePayload

Build the JCS-canonical payload bytes for challenge signing/verification.

Canonical form is a JSON object with keys in alphabetical order:

{"challenge":"<base64url>","did":"<did>","nonce":"<nonce>","timestamp":"<ISO8601>"}

The WASM crypto backend's jcsCanonicalize handles RFC 8785 ordering.

export declare const buildChallengePayload: (challenge: Challenge, did: string) => Uint8Array;

Source: aegis/sdks/typescript/src/auth/challenge.ts:53.

Challenge

A challenge issued by the verifier to an authenticating entity.

/** A challenge issued by the verifier to an authenticating entity. */
export interface Challenge {
    /** 32 cryptographically random bytes. */
    challengeBytes: Uint8Array;
    /** ISO 8601 timestamp of challenge creation. */
    timestamp: string;
    /** Verifier-generated nonce (UUID v7). */
    nonce: string;
    /** Expiry timestamp (creation time + 60 seconds). */
    expiresAt: string;
}

Source: aegis/sdks/typescript/src/auth/challenge.ts:19.

ChallengeVerifier

Challenge-response verifier with in-memory nonce tracking.

Production deployments should swap the in-memory nonce set for a TTL- backed cache or database via the {@link NonceStore } abstraction in auth/store.ts.

export declare class ChallengeVerifier {
  verifyResponse(challenge: Challenge, did: string, signatureB64: string, publicKey: Uint8Array): void;
  clearNonces(): void;
}

Source: aegis/sdks/typescript/src/auth/challenge.ts:71.

SessionManagerOptions

export interface SessionManagerOptions {
    humanLifetimeMs?: number;
    agentLifetimeMs?: number;
}

Source: aegis/sdks/typescript/src/auth/session.ts:17.

SessionManager

export declare class SessionManager {
  humanLifetimeMs: number;
  agentLifetimeMs: number;
  constructor(opts?: SessionManagerOptions): SessionManager;
  createSession(params: { did: string; provider: string; scope?: string[]; isAgent: boolean; deviceBinding?: string | null; }): Session;
  getSession(sessionId: string): Session;
  revokeSession(sessionId: string): void;
  isValid(sessionId: string): boolean;
  cleanupExpired(): number;
  sessionCount(): number;
}

Source: aegis/sdks/typescript/src/auth/session.ts:22.

ChallengeResponseProvider

Auth provider implementing the AEGIS challenge-response protocol.

Validates signed_challenge credentials by:

  1. Resolving the DID via the registered DID resolver
  2. Extracting the primary authentication public key
  3. Reconstructing the challenge and verifying the Ed25519 signature
export declare class ChallengeResponseProvider {
  constructor(resolver: DidResolver): ChallengeResponseProvider;
  providerName(): string;
  verifier(): ChallengeVerifier;
  validate(credential: AuthCredential): Promise<AuthContext>;
  getIdentity(ctx: AuthContext): Promise<AegisIdentity>;
}

Source: aegis/sdks/typescript/src/auth/provider.ts:33.

ApiKeyProvider

Simple API key auth provider for service-to-service communication.

Maps opaque API keys to DIDs. Suitable for internal services that authenticate via pre-shared keys rather than challenge-response.

export declare class ApiKeyProvider {
  constructor(initial?: Record<string, string>): ApiKeyProvider;
  providerName(): string;
  registerKey(key: string, did: string): void;
  revokeKey(key: string): boolean;
  validate(credential: AuthCredential): Promise<AuthContext>;
  getIdentity(ctx: AuthContext): Promise<AegisIdentity>;
}

Source: aegis/sdks/typescript/src/auth/provider.ts:145.

SessionStore

// ---------------------------------------------------------------------------
// SessionStore
// ---------------------------------------------------------------------------
export interface SessionStore {
    storeSession(session: Session): Promise<void>;
    getSession(sessionId: string): Promise<Session | null>;
    deleteSession(sessionId: string): Promise<boolean>;
    listByDid(did: string, pagination?: Pagination): Promise<Session[]>;
    cleanupExpired(): Promise<number>;
}

Source: aegis/sdks/typescript/src/auth/store.ts:17.

InMemorySessionStore

export declare class InMemorySessionStore {
  storeSession(session: Session): Promise<void>;
  getSession(sessionId: string): Promise<Session | null>;
  deleteSession(sessionId: string): Promise<boolean>;
  listByDid(did: string, pagination?: Pagination): Promise<Session[]>;
  cleanupExpired(): Promise<number>;
}

Source: aegis/sdks/typescript/src/auth/store.ts:25.

NonceStore

// ---------------------------------------------------------------------------
// NonceStore
// ---------------------------------------------------------------------------
export interface NonceStore {
    /** Returns true if newly recorded, false if already present (replay). */
    recordNonce(nonce: string): Promise<boolean>;
    hasNonce(nonce: string): Promise<boolean>;
    cleanup(): Promise<number>;
}

Source: aegis/sdks/typescript/src/auth/store.ts:65.

InMemoryNonceStore

export declare class InMemoryNonceStore {
  recordNonce(nonce: string): Promise<boolean>;
  hasNonce(nonce: string): Promise<boolean>;
  cleanup(): Promise<number>;
}

Source: aegis/sdks/typescript/src/auth/store.ts:72.

TemporalPolicyEvaluator

export declare class TemporalPolicyEvaluator {
  evaluate(constraints: TemporalConstraints, now?: Date): PolicyDecision;
  evaluateWithCooldown(constraints: TemporalConstraints, now: Date, lastOperation: Date | null): PolicyDecision;
}

Source: aegis/sdks/typescript/src/policy/temporal.ts:17.

parseAmount

Parse a decimal amount string. Throws PolicyError on invalid input.

export declare const parseAmount: (s: string) => number;

Source: aegis/sdks/typescript/src/policy/spending.ts:128.

TransactionInfo

export interface TransactionInfo {
    asset: string;
    amount: string;
    recipient: string;
    chain: string;
}

Source: aegis/sdks/typescript/src/policy/spending.ts:17.

SpendingPolicyEvaluator

export declare class SpendingPolicyEvaluator {
  evaluate(limits: SpendingLimits, tx: TransactionInfo, dailySpent: string): PolicyDecision;
}

Source: aegis/sdks/typescript/src/policy/spending.ts:26.

LineagePolicy

export interface LineagePolicy {
    minConformanceLevel?: number | null;
    maxLineageDepth?: number | null;
    /** When set, requires `verification.livenessStatus === "active"`. */
    requiredHumanRootLiveness?: number | null;
    requiredAttestations: string[];
    bannedHumanRoots: string[];
}

Source: aegis/sdks/typescript/src/policy/lineage.ts:17.

LineagePolicyEvaluator

export declare class LineagePolicyEvaluator {
  evaluate(policy: LineagePolicy, verification: VerificationResult): PolicyDecision;
}

Source: aegis/sdks/typescript/src/policy/lineage.ts:26.

ContractPolicy

export interface ContractPolicy {
    contractAllowlist: string[];
    functionAllowlist: string[];
    chainAllowlist: string[];
    gasLimit?: number | null;
}

Source: aegis/sdks/typescript/src/policy/contract.ts:13.

ContractInteraction

export interface ContractInteraction {
    contractAddress: string;
    functionName: string;
    chain: string;
    gasEstimate?: number | null;
}

Source: aegis/sdks/typescript/src/policy/contract.ts:20.

ContractPolicyEvaluator

export declare class ContractPolicyEvaluator {
  evaluate(policy: ContractPolicy, interaction: ContractInteraction): PolicyDecision;
}

Source: aegis/sdks/typescript/src/policy/contract.ts:27.

composeDecisions

export declare const composeDecisions: (decisions: readonly PolicyDecision[]) => PolicyDecision;

Source: aegis/sdks/typescript/src/policy/composition.ts:18.

isScopeSubset

Returns true if child scope is a subset of parent scope.

Empty fields on parent mean "wildcard" — they accept any child value. Limits on child must be at least as restrictive as the parent's.

export declare const isScopeSubset: (child: DelegationScope, parent: DelegationScope) => boolean;

Source: aegis/sdks/typescript/src/delegate/scope.ts:21.

intersectScopes

Compute the intersection of two scopes.

  • Empty list = wildcard, take the other side
  • Otherwise, set intersection
  • For limits, take the most restrictive value
export declare const intersectScopes: (a: DelegationScope, b: DelegationScope) => DelegationScope;

Source: aegis/sdks/typescript/src/delegate/scope.ts:95.

validateScope

export declare const validateScope: (scope: DelegationScope) => void;

Source: aegis/sdks/typescript/src/delegate/scope.ts:186.

createDelegationProof

Create a delegation proof by signing the delegation with the delegator's key.

Steps per spec §9.7:

  1. Construct delegation object (excluding proof field)
  2. Canonicalize via JCS (RFC 8785)
  3. Sign canonical bytes with delegator's delegation key (Ed25519)
export declare const createDelegationProof: (params: { delegatorDid: string; delegateDid: string; scope: DelegationScope; expires?: string | null; signingKey: Uint8Array; verificationMethod: string; }) => Delegation;

Source: aegis/sdks/typescript/src/delegate/proof.ts:41.

verifyDelegationProof

Verify a delegation proof against the delegator's public key.

Reconstructs the canonical form of the delegation (without the proof), then verifies the Ed25519 signature in the proof's JWS field.

export declare const verifyDelegationProof: (delegation: Delegation, delegatorPublicKey: Uint8Array) => boolean;

Source: aegis/sdks/typescript/src/delegate/proof.ts:99.

DelegationTree

export declare class DelegationTree {
  maxDepth: number;
  constructor(maxDepth?: number): DelegationTree;
  addDelegation(delegation: Delegation): void;
  getDelegationChain(delegateDid: string): Delegation[];
  effectiveScope(delegateDid: string): DelegationScope | null;
  depth(delegateDid: string): number;
  revoke(delegationId: string): string[];
}

Source: aegis/sdks/typescript/src/delegate/tree.ts:18.

RevocationRegistry

export declare class RevocationRegistry {
  revoke(delegationId: string): void;
  isRevoked(delegationId: string): boolean;
  revokeCascade(ids: readonly string[]): void;
  size(): number;
}

Source: aegis/sdks/typescript/src/delegate/revocation.ts:8.

createSessionKey

Create a session key (temporary, scoped, max 24h).

Generates a fresh Ed25519 keypair for the session and signs the grant with the principal's identity key.

export declare const createSessionKey: (params: { principalDid: string; scope: DelegationScope; maxTransactions?: number | null; lifetimeMs: number; principalSigningKey: Uint8Array; verificationMethod: string; }) => CreatedSessionKey;

Source: aegis/sdks/typescript/src/delegate/session_key.ts:43.

CreatedSessionKey

export interface CreatedSessionKey {
    sessionKey: SessionKey;
    /** The ephemeral 32-byte signing key. Caller is responsible for safekeeping. */
    ephemeralSigningKey: Uint8Array;
    ephemeralVerifyingKey: Uint8Array;
}

Source: aegis/sdks/typescript/src/delegate/session_key.ts:21.

DelegationStore

// ---------------------------------------------------------------------------
// DelegationStore
// ---------------------------------------------------------------------------
export interface DelegationStore {
    storeDelegation(delegation: Delegation): Promise<void>;
    getDelegation(id: string): Promise<Delegation | null>;
    listByDelegator(delegatorDid: string, pagination?: Pagination): Promise<Delegation[]>;
    listByDelegate(delegateDid: string, pagination?: Pagination): Promise<Delegation[]>;
    deleteDelegation(id: string): Promise<boolean>;
}

Source: aegis/sdks/typescript/src/delegate/store.ts:17.

InMemoryDelegationStore

export declare class InMemoryDelegationStore {
  storeDelegation(delegation: Delegation): Promise<void>;
  getDelegation(id: string): Promise<Delegation | null>;
  listByDelegator(delegatorDid: string, pagination?: Pagination): Promise<Delegation[]>;
  listByDelegate(delegateDid: string, pagination?: Pagination): Promise<Delegation[]>;
  deleteDelegation(id: string): Promise<boolean>;
}

Source: aegis/sdks/typescript/src/delegate/store.ts:25.

RevocationStore

// ---------------------------------------------------------------------------
// RevocationStore
// ---------------------------------------------------------------------------
export interface RevocationStore {
    revoke(delegationId: string): Promise<void>;
    isRevoked(delegationId: string): Promise<boolean>;
    revokeBatch(ids: readonly string[]): Promise<void>;
}

Source: aegis/sdks/typescript/src/delegate/store.ts:65.

InMemoryRevocationStore

export declare class InMemoryRevocationStore {
  revoke(delegationId: string): Promise<void>;
  isRevoked(delegationId: string): Promise<boolean>;
  revokeBatch(ids: readonly string[]): Promise<void>;
}

Source: aegis/sdks/typescript/src/delegate/store.ts:71.

WalletAddress

export interface WalletAddress {
    chain: Chain;
    address: string;
    derivationPath: string;
    publicKeyHex: string;
}

Source: aegis/sdks/typescript/src/wallet/address.ts:26.

AddressDeriver

export declare class AddressDeriver {
  derivationPath(chain: Chain, account: number, index: number): string;
  deriveAddress(chain: Chain, publicKeyBytes: Uint8Array): WalletAddress;
  deriveAll(publicKeyBytes: Uint8Array, chains: readonly Chain[]): WalletAddress[];
}

Source: aegis/sdks/typescript/src/wallet/address.ts:33.

verifySignature

Verify an Ed25519 signature against a message and public key.

export declare const verifySignature: (publicKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean;

Source: aegis/sdks/typescript/src/wallet/ceremony.ts:81.

SigningRequest

export interface SigningRequest {
    message: Uint8Array;
    signerDid: string;
    chain?: Chain | null;
}

Source: aegis/sdks/typescript/src/wallet/ceremony.ts:16.

SigningResult

export interface SigningResult {
    signature: Uint8Array;
    publicKey: Uint8Array;
    mode: SigningMode;
}

Source: aegis/sdks/typescript/src/wallet/ceremony.ts:22.

SigningBackend

export interface SigningBackend {
    sign(request: SigningRequest): Promise<SigningResult>;
    publicKey(): Uint8Array;
    mode(): SigningMode;
}

Source: aegis/sdks/typescript/src/wallet/ceremony.ts:28.

DirectSigner

Direct signing backend using a single Ed25519 key.

The signing key is stored in memory; callers should treat the instance as sensitive material and zeroize when done.

export declare class DirectSigner {
  constructor(signingKey: Uint8Array): DirectSigner;
  sign(request: SigningRequest): Promise<SigningResult>;
  publicKey(): Uint8Array;
  mode(): SigningMode;
}

Source: aegis/sdks/typescript/src/wallet/ceremony.ts:40.

makeTransaction

export declare const makeTransaction: (params: { fromDid: string; to: string; chain: string; data: Uint8Array; value?: string | null; }) => Transaction;

Source: aegis/sdks/typescript/src/wallet/pipeline.ts:36.

Transaction

export interface Transaction {
    txId: string;
    fromDid: string;
    to: string;
    chain: string;
    data: Uint8Array;
    value?: string | null;
}

Source: aegis/sdks/typescript/src/wallet/pipeline.ts:27.

AuthorizedTransaction

export interface AuthorizedTransaction {
    transaction: Transaction;
    signature: Uint8Array;
    fulfilledObligations: string[];
}

Source: aegis/sdks/typescript/src/wallet/pipeline.ts:53.

TransactionPipeline

Full transaction authorization pipeline per AEGIS Spec §10.4.

Enforces a strict 5-step process; if any step fails the transaction is NOT signed.

export declare class TransactionPipeline {
  constructor(signer: SigningBackend): TransactionPipeline;
  authorizeAndSign(tx: Transaction, auth: AuthContext, policyDecision: PolicyDecision): Promise<AuthorizedTransaction>;
}

Source: aegis/sdks/typescript/src/wallet/pipeline.ts:65.

StorageBackend

Storage backend selection.

/** Storage backend selection. */
export type StorageBackend = {
    type: "in_memory";
} | {
    type: "postgres";
    url: string;
};

Source: aegis/sdks/typescript/src/sdk/config.ts:11.

SessionConfig

export interface SessionConfig {
    /** Maximum lifetime for human sessions in seconds (default: 86400 = 24h). */
    humanLifetimeSecs: number;
    /** Maximum lifetime for agent sessions in seconds (default: 3600 = 1h). */
    agentLifetimeSecs: number;
    /** Maximum lifetime for session keys in seconds (default: 86400 = 24h). */
    sessionKeyMaxSecs: number;
}

Source: aegis/sdks/typescript/src/sdk/config.ts:15.

KeyConfig

export interface KeyConfig {
    encryptionAlgorithm: string;
    zeroizeOnDrop: boolean;
}

Source: aegis/sdks/typescript/src/sdk/config.ts:24.

AegisConfig

export interface AegisConfig {
    verification: VerificationConfig;
    sessions: SessionConfig;
    keys: KeyConfig;
    storageBackend: StorageBackend;
}

Source: aegis/sdks/typescript/src/sdk/config.ts:29.

DEFAULT_SESSION_CONFIG

export declare const DEFAULT_SESSION_CONFIG: SessionConfig;

Source: aegis/sdks/typescript/src/sdk/config.ts:36.

DEFAULT_KEY_CONFIG

export declare const DEFAULT_KEY_CONFIG: KeyConfig;

Source: aegis/sdks/typescript/src/sdk/config.ts:42.

DEFAULT_AEGIS_CONFIG

export declare const DEFAULT_AEGIS_CONFIG: AegisConfig;

Source: aegis/sdks/typescript/src/sdk/config.ts:47.

defaultAegisStores

export declare const defaultAegisStores: () => AegisStores;

Source: aegis/sdks/typescript/src/sdk/client.ts:81.

AegisStores

Collection of pluggable persistent storage backends used by the client.

Defaults to in-memory implementations. Application code may inject Postgres-backed (or any other) implementations via withStores.

/**
 * Collection of pluggable persistent storage backends used by the client.
 *
 * Defaults to in-memory implementations. Application code may inject
 * Postgres-backed (or any other) implementations via `withStores`.
 */
export interface AegisStores {
    sessionStore: SessionStore;
    nonceStore: NonceStore;
    delegationStore: DelegationStore;
    revocationStore: RevocationStore;
    keyStore: KeyStore;
    verificationCacheStore: VerificationCacheStore;
}

Source: aegis/sdks/typescript/src/sdk/client.ts:72.

AegisClient

Unified AEGIS client.

Holds a [PluginRegistry], a verification pipeline, a session manager, a delegation tree, and (optionally) a transaction pipeline. Storage backends are accessible via the stores field.

export declare class AegisClient {
  registry: PluginRegistry;
  verifier: VerificationPipeline;
  sessions: SessionManager;
  delegations: DelegationTree;
  config: AegisConfig;
  stores: AegisStores;
  constructor(params: { registry: PluginRegistry; config?: AegisConfig; stores?: AegisStores; }): AegisClient;
  withDefaults(registry: PluginRegistry): AegisClient;
  withSigner(signer: SigningBackend): this;
  verifyIdentity(did: string): Promise<VerificationResult>;
  verifyIdentityFresh(did: string): Promise<VerificationResult>;
  authenticate(credential: AuthCredential, identityType: IdentityType): Promise<Session>;
  getSession(sessionId: string): Session;
  revokeSession(sessionId: string): void;
  isSessionValid(sessionId: string): boolean;
  authorize(request: PolicyRequest): Promise<PolicyDecision>;
  composePolicyDecisions(decisions: readonly PolicyDecision[]): PolicyDecision;
  delegate(params: { delegatorDid: string; delegateDid: string; scope: DelegationScope; expires?: string | null; signingKey: Uint8Array; verificationMethod: string; }): Delegation;
  verifyDelegation(delegation: Delegation, delegatorPublicKey: Uint8Array): boolean;
  revokeDelegation(delegationId: string): string[];
  signTransaction(tx: Transaction, auth: AuthContext, policyDecision: PolicyDecision): Promise<AuthorizedTransaction>;
  transactions(): TransactionPipeline | null;
}

Source: aegis/sdks/typescript/src/sdk/client.ts:99.

On this page

chainCoinTypederivationStandardmakePaginationIdentityTypeAegisIdentityAuthContextAuthCredentialSessionPolicyContextLineageSummaryPolicyRequestObligationTypeObligationAuditInfoPolicyDecisionPermissionCheckRevocationStatusLivenessStatusVerificationResultVerificationConfigDEFAULT_VERIFICATION_CONFIGActiveHoursTemporalConstraintsSpendingLimitsDelegationScopeDelegationProofDelegationSessionKeyWalletTypeChainCHAIN_VALUESSigningModeBatchModeKeyRoleKeyGenerationModeThresholdConfigGuardianTypeGuardianRecoveryConfigMAX_PAGE_SIZEDEFAULT_PAGE_SIZEPaginationDEFAULT_PAGINATIONIdentityTypeSchemaChainSchemaKeyRoleSchemaSpendingLimitsSchemaActiveHoursSchemaTemporalConstraintsSchemaDelegationScopeSchemaDelegationProofSchemaDelegationSchemaResolverErrorAuthErrorPolicyErrorVerificationErrorKeyErrorDelegationErrorWalletErrorAegisErrorAegisExceptionresolverErrorsauthErrorspolicyErrorsverificationErrorskeyErrorsdelegationErrorswalletErrorsinferIdentityTypeFromDidLifecycleStatusEntityKindVerificationMethodLineageSectionAgentLineageProofDocumentMetadataDocumentProofOasDocumentoasDocumentCreateDidParamsDidCreationResultDidResolverAuthProviderPolicyEnginePluginRegistrysetCryptoBackendcryptoBackendloadDefaultCryptoBackendCryptoBackendFrostKeyPackagebase64UrlEncodebase64UrlDecodehexEncodehexDecodeutf8Encodeutf8DecodeconcatBytesu32BeBytesVerificationPipelineVerificationCacheVerificationCacheStoreInMemoryVerificationCacheStorederiveLineageKeyderivationPathEncryptedKeyManagedKeyKeyGeneratorisRotationEligibleRotationRequestRotationResultKeyRotationparseIso8601DurationMsGuardianAuthorizationRecoveryCeremonyKeyStoreInMemoryKeyStoregenerateSharessignWithThresholdverifyThresholdSignatureThresholdKeyPackagesFrostCeremonygenerateChallengebuildChallengePayloadChallengeChallengeVerifierSessionManagerOptionsSessionManagerChallengeResponseProviderApiKeyProviderSessionStoreInMemorySessionStoreNonceStoreInMemoryNonceStoreTemporalPolicyEvaluatorparseAmountTransactionInfoSpendingPolicyEvaluatorLineagePolicyLineagePolicyEvaluatorContractPolicyContractInteractionContractPolicyEvaluatorcomposeDecisionsisScopeSubsetintersectScopesvalidateScopecreateDelegationProofverifyDelegationProofDelegationTreeRevocationRegistrycreateSessionKeyCreatedSessionKeyDelegationStoreInMemoryDelegationStoreRevocationStoreInMemoryRevocationStoreWalletAddressAddressDeriververifySignatureSigningRequestSigningResultSigningBackendDirectSignermakeTransactionTransactionAuthorizedTransactionTransactionPipelineStorageBackendSessionConfigKeyConfigAegisConfigDEFAULT_SESSION_CONFIGDEFAULT_KEY_CONFIGDEFAULT_AEGIS_CONFIGdefaultAegisStoresAegisStoresAegisClient