Created

Event v273 → current #0

Emitted when a new crowdloan campaign is created.

View events on chain
Useful for: stakersdevelopersanalytics

The Big Picture

A new crowdfunding campaign has launched.

Use Cases

  • Track new campaigns
  • Monitor ecosystem fundraising

From Chain Metadata

A crowdloan was created.

Triggers

Emitted by

Preconditions

  • Creator has sufficient balance
  • Parameters are valid

Effects

Storage Modified

Postconditions

  • Crowdloan created
  • Deposit transferred

Side Effects

  • NextCrowdloanId incremented

Event Data

#NameTypeDescription
0
crowdloan_id
u32 Unique identifier for the crowdloan
1
creator
AccountId Account that created the crowdloan (hex -> SS58)
2
end
→ end_block
u32 Block number when campaign ends
3
cap
u64 Maximum TAO to raise (RAO)

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Subscribe to Created events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Crowdloan") &&
      event.method === "Created"
    )
    .forEach(({ event }) => {
      console.log("Created:", event.data.toHuman());
    });
});

Runtime Info

Pallet Index
27
Event Index
0
First Version
v273
Current Version
v393