Agent class
Provides a common context for all plugin methods.
This is the main entry point into the API of Veramo. When plugins are installed, they extend the API of the agent and the methods they provide can all use the common context so that plugins can build on top of each other and create a richer experience.
Signature:
export declare class Agent implements IAgent
Implements: IAgent
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(options) | Constructs a new instance of the Agent class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
context? | readonly | Record<string, any> | (Optional) |
methods | readonly | IPluginMethodMap | The map of plugin + override methods |
Methods
Method | Modifiers | Description |
---|---|---|
availableMethods() | Lists available agent method names | |
emit(eventType, data) | Broadcasts an Listeners are During creation, the agent automatically registers listener plugins to the Events are processed asynchronously, so the general pattern to be used is fire-and-forget. Ex: In situations where you need to make sure that all events in the queue have been exhausted, the In case an error is thrown while processing an event, the error is re-emitted as an event of type Note that | |
execute(method, args) | Executes a plugin method. Normally, the | |
getSchema() | Returns agent plugin schema |