bittensor.core.chain_data.crowdloan_info#

Classes#

CrowdloanConstants

Represents all runtime constants defined in the pallet-crowdloan.

CrowdloanInfo

Represents a single on-chain crowdloan campaign from the pallet-crowdloan.

Module Contents#

class bittensor.core.chain_data.crowdloan_info.CrowdloanConstants#

Represents all runtime constants defined in the pallet-crowdloan.

These attributes correspond directly to on-chain configuration constants exposed by the Crowdloan pallet. They define contribution limits, duration bounds, pallet identifiers, and refund behavior that govern how crowdloan campaigns operate within the Subtensor network.

Each attribute is fetched directly from the runtime via Subtensor.substrate.get_constant(“Crowdloan”, <name>) and reflects the current chain configuration at the time of retrieval.

Variables:
  • AbsoluteMinimumContribution – The absolute minimum amount required to contribute to any crowdloan.

  • MaxContributors – The maximum number of unique contributors allowed per crowdloan.

  • MaximumBlockDuration – The maximum allowed duration (in blocks) for a crowdloan campaign.

  • MinimumDeposit – The minimum deposit required from the creator to open a new crowdloan.

  • MinimumBlockDuration – The minimum allowed duration (in blocks) for a crowdloan campaign.

  • RefundContributorsLimit – The maximum number of contributors that can be refunded in single on-chain refund call.

Note

All Balance amounts are in RAO.

AbsoluteMinimumContribution: bittensor.utils.balance.Balance | None#
MaxContributors: int | None#
MaximumBlockDuration: int | None#
MinimumBlockDuration: int | None#
MinimumDeposit: bittensor.utils.balance.Balance | None#
RefundContributorsLimit: int | None#
classmethod constants_names()#

Returns the list of all constant field names defined in this dataclass.

Return type:

list[str]

classmethod from_dict(data)#

Creates a CrowdloanConstants instance from a dictionary of decoded chain constants.

Parameters:

data (dict) – Dictionary mapping constant names to their decoded values (returned by Subtensor.query_constant()).

Returns:

The structured dataclass with constants filled in.

Return type:

CrowdloanConstants

class bittensor.core.chain_data.crowdloan_info.CrowdloanInfo#

Represents a single on-chain crowdloan campaign from the pallet-crowdloan.

Each instance reflects the current state of a specific crowdloan as stored in chain storage. It includes funding details, creator information, contribution totals, and optional call/target data that define what happens upon successful finalization.

Variables:
  • id – The unique identifier (index) of the crowdloan.

  • creator – The SS58 address of the creator (campaign initiator).

  • deposit – The creator’s initial deposit locked to open the crowdloan.

  • min_contribution – The minimum contribution amount allowed per participant.

  • end – The block number when the campaign ends.

  • cap – The maximum amount to be raised (funding cap).

  • funds_account – The account ID holding the crowdloan’s funds.

  • raised – The total amount raised so far.

  • target_address – Optional SS58 address to which funds are transferred upon success.

  • call – Optional encoded runtime call (e.g., a register_leased_network extrinsic) to execute on finalize.

  • finalized – Whether the crowdloan has been finalized on-chain.

  • contributors_count – Number of unique contributors currently participating.

call: str | None#
cap: bittensor.utils.balance.Balance#
contributors_count: int#
creator: str#
deposit: bittensor.utils.balance.Balance#
end: int#
finalized: bool#
classmethod from_dict(idx, data)#

Returns a CrowdloanInfo object from decoded chain data.

Parameters:
Return type:

CrowdloanInfo

funds_account: str#
id: int#
min_contribution: bittensor.utils.balance.Balance#
raised: bittensor.utils.balance.Balance#
target_address: str | None#