Actor
Defined in: packages/agent/src/actor.ts:191
An actor base class. An actor is an object containing only functions that will return a promise. These functions are derived from the IDL definition.
Constructor
Section titled “Constructor”
protectednew Actor(metadata):Actor
Defined in: packages/agent/src/actor.ts:304
Parameters
Section titled “Parameters”metadata
Section titled “metadata”ActorMetadata
Returns
Section titled “Returns”Actor
Methods
Section titled “Methods”agentOf()
Section titled “agentOf()”
staticagentOf(actor):undefined|Agent
Defined in: packages/agent/src/actor.ts:197
Get the Agent class this Actor would call, or undefined if the Actor would use the default agent (global.ic.agent).
Parameters
Section titled “Parameters”Actor
The actor to get the agent of.
Returns
Section titled “Returns”undefined | Agent
canisterIdOf()
Section titled “canisterIdOf()”
staticcanisterIdOf(actor):Principal
Defined in: packages/agent/src/actor.ts:209
Parameters
Section titled “Parameters”Actor
Returns
Section titled “Returns”createActor()
Section titled “createActor()”
staticcreateActor<T>(interfaceFactory,configuration):ActorSubclass<T>
Defined in: packages/agent/src/actor.ts:256
Type Parameters
Section titled “Type Parameters”T = Record<string, ActorMethod<unknown[], unknown>>
Parameters
Section titled “Parameters”interfaceFactory
Section titled “interfaceFactory”configuration
Section titled “configuration”Returns
Section titled “Returns”createActorClass()
Section titled “createActorClass()”
staticcreateActorClass(interfaceFactory,options?):ActorConstructor
Defined in: packages/agent/src/actor.ts:213
Parameters
Section titled “Parameters”interfaceFactory
Section titled “interfaceFactory”options?
Section titled “options?”Returns
Section titled “Returns”createActorWithExtendedDetails()
Section titled “createActorWithExtendedDetails()”
staticcreateActorWithExtendedDetails<T>(interfaceFactory,configuration,actorClassOptions):ActorSubclass<ActorMethodMappedExtended<T>>
Defined in: packages/agent/src/actor.ts:289
Returns an actor with methods that return the http response details along with the result
Type Parameters
Section titled “Type Parameters”T = Record<string, ActorMethod<unknown[], unknown>>
Parameters
Section titled “Parameters”interfaceFactory
Section titled “interfaceFactory”the interface factory for the actor
configuration
Section titled “configuration”the configuration for the actor
actorClassOptions
Section titled “actorClassOptions”CreateActorClassOpts = ...
options for the actor class extended details to return with the result
Returns
Section titled “Returns”ActorSubclass<ActorMethodMappedExtended<T>>
createActorWithHttpDetails()
Section titled “createActorWithHttpDetails()”
staticcreateActorWithHttpDetails<T>(interfaceFactory,configuration):ActorSubclass<ActorMethodMappedWithHttpDetails<T>>
Defined in: packages/agent/src/actor.ts:274
Returns an actor with methods that return the http response details along with the result
Type Parameters
Section titled “Type Parameters”T = Record<string, ActorMethod<unknown[], unknown>>
Parameters
Section titled “Parameters”interfaceFactory
Section titled “interfaceFactory”the interface factory for the actor
configuration
Section titled “configuration”the configuration for the actor
Returns
Section titled “Returns”ActorSubclass<ActorMethodMappedWithHttpDetails<T>>
Deprecated
Section titled “Deprecated”- use createActor with actorClassOptions instead
interfaceOf()
Section titled “interfaceOf()”
staticinterfaceOf(actor):ServiceClass
Defined in: packages/agent/src/actor.ts:205
Get the interface of an actor, in the form of an instance of a Service.
Parameters
Section titled “Parameters”Actor
The actor to get the interface of.