Interface PolicyContext<AllowSchema, DenySchema>

interface PolicyContext<
    AllowSchema extends z.ZodType = z.ZodUndefined,
    DenySchema extends z.ZodType = z.ZodUndefined,
> {
    allow: AllowSchema extends ZodUndefined
        ? () => ContextAllowResponseNoResult
        : (
            result: TypeOf<AllowSchema>,
        ) => ContextAllowResponse<TypeOf<AllowSchema>>;
    deny: DenySchema extends ZodUndefined
        ? () => ContextDenyResponseNoResult
        : (
            result: TypeOf<DenySchema>,
            runtimeError?: string,
        ) => ContextDenyResponse<TypeOf<DenySchema>>;
    abilityIpfsCid: string;
    appId: number;
    appVersion: number;
    delegation: {
        delegateeAddress: string;
        delegatorPkpInfo: {
            tokenId: string;
            ethAddress: string;
            publicKey: string;
        };
    };
}

Type Parameters

  • AllowSchema extends z.ZodType = z.ZodUndefined
  • DenySchema extends z.ZodType = z.ZodUndefined

Hierarchy

  • BaseContext
    • PolicyContext

Properties

allow: AllowSchema extends ZodUndefined
    ? () => ContextAllowResponseNoResult
    : (
        result: TypeOf<AllowSchema>,
    ) => ContextAllowResponse<TypeOf<AllowSchema>>
deny: DenySchema extends ZodUndefined
    ? () => ContextDenyResponseNoResult
    : (
        result: TypeOf<DenySchema>,
        runtimeError?: string,
    ) => ContextDenyResponse<TypeOf<DenySchema>>
abilityIpfsCid: string
appId: number
appVersion: number
delegation: {
    delegateeAddress: string;
    delegatorPkpInfo: {
        tokenId: string;
        ethAddress: string;
        publicKey: string;
    };
}