Withdrew
Event v273 → current #2Emitted when a contribution is withdrawn from a crowdloan.
View events on chainUseful for: stakersdevelopersanalytics
The Big Picture
A contributor has exited a campaign.
Use Cases
- Track withdrawals
From Chain Metadata
A contribution was withdrawn from a failed crowdloan.
Triggers
Emitted by
Preconditions
- Crowdloan not finalized
- Contributor has contribution
Effects
Storage Modified
Postconditions
- Contribution returned
Side Effects
- Total raised decreased
Event Data
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 Withdrew events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("Crowdloan") &&
event.method === "Withdrew"
)
.forEach(({ event }) => {
console.log("Withdrew:", event.data.toHuman());
});
});Runtime Info
- Pallet Index
- 27
- Event Index
- 2
- First Version
- v273
- Current Version
- v393