live · mainnetoc · docs
specs · api · guides
docs / documentation

@orangecheck/pledge-core


@orangecheck/pledge-core / DelegationLookup

Type Alias: DelegationLookup

type DelegationLookup = (delegationId: string, nowIso: string) => Promise<
  | DelegationLookupResult
| null>;

Defined in: pledge-core/src/types.ts:309

Caller-supplied delegation resolver. Returns the resolved delegation fields (principal, agent, scope strings, expires_at) or null if the delegation cannot be resolved or its signature does not verify.

The adapter is responsible for fetching the delegation envelope from wherever it lives (typically Nostr kind 30083 with d-tag oc-agent-del:<delegation_id>) and running OC Agent's full verifyDelegation check before returning the typed shape. pledge-core trusts the adapter's output for the §7.3 1–5 logic.

Parameters

ParameterType
delegationIdstring
nowIsostring

Returns

Promise&lt; | DelegationLookupResult | null>