Finalized
Event v273 → current #5Emitted when a crowdloan successfully reaches its cap.
View events on chainUseful for: stakersdevelopersanalytics
The Big Picture
A campaign has succeeded!
Use Cases
- Track successful campaigns
From Chain Metadata
A crowdloan was finalized, funds were transferred and the call was dispatched.
Triggers
Emitted by
Preconditions
- Crowdloan reached cap
- Creator finalized
Effects
Storage Modified
Postconditions
- Funds transferred
- Call dispatched if configured
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | crowdloan_id | u32 CrowdloanId | Crowdloan identifier |
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 Finalized events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.Crowdloan.Finalized.get(block.hash);
for (const evt of events) {
console.log("Finalized:", evt.payload);
}
});Runtime Info
- Pallet Index
- 27
- Event Index
- 5
- First Version
- v273
- Current Version
- v411