IfElseMainSuccess

Event v320 → current #6

Emitted when the main call in if_else succeeded.

View events on chain
Useful for: developerswallets

The Big Picture

Primary path worked - fallback wasn't needed.

Use Cases

  • Confirm primary operation succeeded

From Chain Metadata

Main call was dispatched.

Triggers

Emitted by

Preconditions

  • if_else call executed
  • Main call succeeded

Effects

Postconditions

  • Main call's effects applied

This event has no data fields.

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

Runtime Info

Pallet Index
11
Event Index
6
First Version
v320
Current Version
v411