Skip to content

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.

protected new Actor(metadata): Actor

Defined in: packages/agent/src/actor.ts:303

ActorMetadata

Actor

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).

Actor

The actor to get the agent of.

undefined | Agent


static canisterIdOf(actor): Principal

Defined in: packages/agent/src/actor.ts:208

Actor

Principal


static createActor<T>(interfaceFactory, configuration): ActorSubclass<T>

Defined in: packages/agent/src/actor.ts:255

T = Record<string, ActorMethod<unknown[], unknown>>

InterfaceFactory

ActorConfig

ActorSubclass<T>


static createActorClass(interfaceFactory, options?): ActorConstructor

Defined in: packages/agent/src/actor.ts:212

InterfaceFactory

CreateActorClassOpts

ActorConstructor


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

T = Record<string, ActorMethod<unknown[], unknown>>

InterfaceFactory

the interface factory for the actor

ActorConfig

the configuration for the actor

CreateActorClassOpts = ...

options for the actor class extended details to return with the result

ActorSubclass<ActorMethodMappedExtended<T>>


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

T = Record<string, ActorMethod<unknown[], unknown>>

InterfaceFactory

the interface factory for the actor

ActorConfig

the configuration for the actor

ActorSubclass<ActorMethodMappedWithHttpDetails<T>>

  • use createActor with actorClassOptions instead

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.

Actor

The actor to get the interface of.

ServiceClass