Skip to content
IC Reactor

ServiceOf

ServiceOf<R> = R["_actor"]

Defined in: core/src/types/reactor.ts:285

The service type of a reactor, read from the reactor’s own type. Pass typeof reactor for a Reactor, a DisplayReactor or a subclass of either.

Code that has only the reactor in scope, such as a component that imports it, then needs neither the service type exported next to it nor the transform spelled out. ReactorArgsOf, ReactorDataOf and ReactorErrorOf build on it.

R extends object

The reactor’s type, as typeof reactor.

const ledger = new DisplayReactor<Ledger>({ clientManager, name: "ledger", idlFactory })
// "icrc1_balance_of" | "icrc1_transfer" | ...
type LedgerMethod = FunctionName<ServiceOf<typeof ledger>>