Constructors

Methods

  • Cancels a task.

    Parameters

    • taskId: string

      The ID of the task.

    Returns Promise<void>

    A promise that resolves when the task is canceled.

  • Completes a task.

    Parameters

    • taskId: string

      The ID of the task.

    • result: string

      The result of the task.

    Returns Promise<void>

    A promise that resolves when the task is completed.

  • Creates a new task.

    Parameters

    • params: TaskCreationParams

      The parameters for task creation.

    Returns Promise<TaskData>

    A promise that resolves to the task ID.

  • Gets data for a specific agent.

    Parameters

    • agentId: string

    Returns Promise<AgentData>

    A promise that resolves to the agent data.

  • Gets a service by name.

    Parameters

    • name: string

      The name of the service.

    Returns Promise<Service>

    A promise that resolves to the service.

  • Gets data for a specific task.

    Parameters

    • taskId: string

      The ID of the task.

    Returns Promise<TaskData>

    A promise that resolves to the task data.

  • Gets tasks by issuer.

    Parameters

    • issuer: string

      The owner of the tasks.

    Returns Promise<bigint[]>

    A promise that resolves to the task IDs.

  • Gets the address of the agent.

    Returns Promise<string>

    A promise that resolves to the agent address.

  • Assigns a rating to a task.

    Parameters

    • taskId: string

      The ID of the task.

    • rating: number

      The rating.

    Returns Promise<void>

    A promise that resolves when the task is assigned.

  • Registers a new agent.

    Parameters

    • address: string

      The address of the agent.

    • metadata: AgentMetadata

      The metadata of the agent.

    • serviceName: string

      The name of the service.

    • servicePrice: number

      The price of the service.

    Returns Promise<boolean>

    A promise that resolves to the agent address.

  • Registers a new service.

    Parameters

    • service: Service

      The service to register.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if the service is registered.

  • Sets a listener for new tasks.

    Parameters

    • listener: (task: TaskData) => void

      The listener function.

    Returns Promise<void>

    A promise that resolves when the listener is set.

  • Starts the Ensemble subscription to the task service.

    Returns Promise<void>

  • Parameters

    • config: ContractConfig
    • signer: Signer
    • ipfsSDK: PinataSDK

    Returns Ensemble