The Vincent Ability Client is used to interact with Vincent abilities.

  • Precheck ability parameters and policies
  • Execute abilities remotely
interface VincentAbilityClient {
    execute(
        rawAbilityParams: TypeOf<AbilityParamsSchema>,
        context: AbilityClientContext,
    ): Promise<
        AbilityExecuteResponse<
            ExecuteSuccessSchema,
            ExecuteFailSchema,
            PoliciesByPackageName,
        >,
    >;
    precheck(
        rawAbilityParams: TypeOf<AbilityParamsSchema>,
        context: AbilityClientContext & { rpcUrl?: string },
    ): Promise<
        AbilityPrecheckResponse<
            PrecheckSuccessSchema,
            PrecheckFailSchema,
            PoliciesByPackageName,
        >,
    >;
}

Methods

  • Executes the ability with the given parameters.

    This method validates the ability parameters, executes the ability remotely, and returns the result.

    Parameters

    • rawAbilityParams: TypeOf<AbilityParamsSchema>

      The parameters to be passed to the ability

    • context: AbilityClientContext

      The context for the ability execution, including the delegator PKP Ethereum address

    Returns Promise<
        AbilityExecuteResponse<
            ExecuteSuccessSchema,
            ExecuteFailSchema,
            PoliciesByPackageName,
        >,
    >

    A promise that resolves to a AbilityResponse containing the execution result

  • Performs a precheck of the ability parameters and policies.

    This method validates the ability parameters and checks if the policies allow the ability to be executed.

    Parameters

    • rawAbilityParams: TypeOf<AbilityParamsSchema>

      The parameters to be passed to the ability

    • context: AbilityClientContext & { rpcUrl?: string }

      The context for the ability execution, including the delegator PKP Ethereum address

    Returns Promise<
        AbilityPrecheckResponse<
            PrecheckSuccessSchema,
            PrecheckFailSchema,
            PoliciesByPackageName,
        >,
    >

    A promise that resolves to a AbilityResponse containing the precheck result