DispatchedAs

Event v120 → current #5

Emitted when a call was dispatched with a different origin.

View events on chain
Useful for: developersvalidatorsanalytics

The Big Picture

Audit trail for origin impersonation by root.

Use Cases

  • Audit governance actions

From Chain Metadata

A call was dispatched.

Triggers

Preconditions

  • dispatch_as called by root

Effects

Postconditions

  • Result recorded

Side Effects

  • Provides audit trail

Event Data

#NameTypeDescription
0
result
Result DispatchResultResult of the dispatched call (Ok or Err)

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to DispatchedAs events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Utility.DispatchedAs.get(block.hash);
  for (const evt of events) {
    console.log("DispatchedAs:", evt.payload);
  }
});

Runtime Info

Pallet Index
11
Event Index
5
First Version
v120
Current Version
v411