withdraw

Call v273 → current #2

Withdraws your contribution from an active crowdloan.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: stakersdevelopers

The Big Picture

Contributors can withdraw at any time before finalization.

Use Cases

  • Exit campaign before finalization

From Chain Metadata

Withdraw a contribution from an active (not yet finalized or dissolved) crowdloan. Only contributions over the deposit can be withdrawn by the creator. The dispatch origin for this call must be _Signed_. Parameters: `crowdloan_id`: The id of the crowdloan to withdraw from.

Input Parameters

#NameTypeDescription
0
crowdloan_id
Compact<u32> Cpt CrowdloanIdcrowdloan_id: Crowdloan identifier (SCALE compact -> integer)

Permissions

Origin
Signed
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Crowdloan not finalized
  • Signer has contribution

Effects

Events Emitted

Storage Modified

Postconditions

  • Contribution returned
  • Withdrew event emitted

Side Effects

  • Decreases total raised

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);

// Build withdraw call (typed, named args)
const crowdloan_id = 0;

const tx = api.tx.Crowdloan.withdraw({
  crowdloan_id,
});

Runtime Info

Pallet Index
27
Call Index
2
First Version
v273
Current Version
v411