Canceled

Event v133 → v148, v149 → current #1

Emitted when a scheduled task is cancelled before execution.

View events on chain
Useful for: developersanalytics

The Big Picture

Confirmation that a scheduled task has been removed and will not execute.

Use Cases

  • Confirm task cancellation
  • Track cancelled operations

From Chain Metadata

Canceled some task.

Triggers

Preconditions

  • Cancel call succeeded
  • Task existed at specified position

Effects

Storage Modified

Postconditions

  • Task removed from Agenda
  • Will not execute

Side Effects

  • Deposit returned if reserved

Event Data

#NameTypeDescription
0
when
u32 BlockNumberFor<T>Block number where the task was scheduled
1
index
u32 Index of the cancelled task within the block's agenda

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 Canceled events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.Canceled.get(block.hash);
  for (const evt of events) {
    console.log("Canceled:", evt.payload);
  }
});

Version History

v133 block 1,404,224 2 args
v149 block 3,014,339 2 args Current

Runtime Info

Pallet Index
15
Event Index
1
First Version
v133
Current Version
v411