bittensor.core.extrinsics.pallets.crowdloan#

Classes#

Crowdloan

Factory class for creating GenericCall objects for Crowdloan pallet functions.

Module Contents#

class bittensor.core.extrinsics.pallets.crowdloan.Crowdloan#

Bases: bittensor.core.extrinsics.pallets.base.CallBuilder

Factory class for creating GenericCall objects for Crowdloan pallet functions.

This class provides methods to create GenericCall instances for all Crowdloan pallet extrinsics.

Works with both sync (Subtensor) and async (AsyncSubtensor) instances. For async operations, pass an AsyncSubtensor instance and await the result.

Example

# Sync usage call = Crowdloan(subtensor).finalize(crowdloan_id=123) response = subtensor.sign_and_send_extrinsic(call=call, …)

# Async usage call = await Crowdloan(subtensor).finalize(crowdloan_id=123) response = await async_subtensor.sign_and_send_extrinsic(call=call, …)

contribute(crowdloan_id, amount)#

Returns GenericCall instance for Subtensor function Crowdloan.contribute.

Parameters:
  • crowdloan_id (int) – The unique identifier of the crowdloan to contribute to.

  • amount (int) – Amount in RAO to contribute.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call

create(deposit, min_contribution, cap, end, call=None, target_address=None)#

Returns GenericCall instance for Subtensor function Crowdloan.create.

Parameters:
  • deposit (int) – Initial deposit in RAO from the creator.

  • min_contribution (int) – Minimum contribution amount in RAO.

  • cap (int) – Maximum cap to be raised in RAO.

  • end (int) – Block number when the campaign ends.

  • call (Optional[scalecodec.GenericCall]) – Runtime call data (e.g., subtensor::register_leased_network).

  • target_address (Optional[str]) – SS58 address to transfer funds to on success.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call

dissolve(crowdloan_id)#

Returns GenericCall instance for Subtensor function Crowdloan.dissolve.

Parameters:

crowdloan_id (int) – The unique identifier of the crowdloan to dissolve.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call

finalize(crowdloan_id)#

Returns GenericCall instance for Subtensor function Crowdloan.finalize.

Parameters:

crowdloan_id (int) – The unique identifier of the crowdloan to finalize.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call

refund(crowdloan_id)#

Returns GenericCall instance for Subtensor function Crowdloan.refund.

Parameters:

crowdloan_id (int) – The unique identifier of the crowdloan to refund.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call

update_cap(crowdloan_id, new_cap)#

Returns GenericCall instance for Subtensor function Crowdloan.update_cap.

Parameters:
  • crowdloan_id (int) – The unique identifier of the crowdloan to update the cap for.

  • new_cap (int) – New cap to be raised in RAO.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call

update_end(crowdloan_id, new_end)#

Returns GenericCall instance for Subtensor function Crowdloan.update_end.

Parameters:
  • crowdloan_id (int) – The unique identifier of the crowdloan to update the end block number for.

  • new_end (int) – New end block number.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call

update_min_contribution(crowdloan_id, new_min_contribution)#

Returns GenericCall instance for Subtensor function Crowdloan.update_min_contribution.

Parameters:
  • crowdloan_id (int) – The unique identifier of the crowdloan to update the minimum contribution amount for.

  • new_min_contribution (int) – New minimum contribution amount in RAO.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call

withdraw(crowdloan_id)#

Returns GenericCall instance for Subtensor function Crowdloan.withdraw.

Parameters:

crowdloan_id (int) – The unique identifier of the crowdloan to withdraw from.

Returns:

GenericCall instance.

Return type:

bittensor.core.extrinsics.pallets.base.Call