Actor
Defined in: packages/agent/src/actor.ts:190
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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”
protected
new Actor(metadata
):Actor
Defined in: packages/agent/src/actor.ts:303
Parameters
Section titled “Parameters”metadata
Section titled “metadata”ActorMetadata
Returns
Section titled “Returns”Actor
Methods
Section titled “Methods”agentOf()
Section titled “agentOf()”
static
agentOf(actor
):undefined
|Agent
Defined in: packages/agent/src/actor.ts:196
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()”
static
canisterIdOf(actor
):Principal
Defined in: packages/agent/src/actor.ts:208
Parameters
Section titled “Parameters”Actor
Returns
Section titled “Returns”createActor()
Section titled “createActor()”
static
createActor<T
>(interfaceFactory
,configuration
):ActorSubclass
<T
>
Defined in: packages/agent/src/actor.ts:255
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()”
static
createActorClass(interfaceFactory
,options?
):ActorConstructor
Defined in: packages/agent/src/actor.ts:212
Parameters
Section titled “Parameters”interfaceFactory
Section titled “interfaceFactory”options?
Section titled “options?”Returns
Section titled “Returns”createActorWithExtendedDetails()
Section titled “createActorWithExtendedDetails()”
static
createActorWithExtendedDetails<T
>(interfaceFactory
,configuration
,actorClassOptions
):ActorSubclass
<ActorMethodMappedExtended
<T
>>
Defined in: packages/agent/src/actor.ts:288
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()”
static
createActorWithHttpDetails<T
>(interfaceFactory
,configuration
):ActorSubclass
<ActorMethodMappedWithHttpDetails
<T
>>
Defined in: packages/agent/src/actor.ts:273
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()”
static
interfaceOf(actor
):ServiceClass
Defined in: packages/agent/src/actor.ts:204
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.