bittensor.core.extrinsics.pallets.crowdloan#
Classes#
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.CallBuilderFactory 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.
- 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.
- update_end(crowdloan_id, new_end)#
Returns GenericCall instance for Subtensor function Crowdloan.update_end.
- update_min_contribution(crowdloan_id, new_min_contribution)#
Returns GenericCall instance for Subtensor function Crowdloan.update_min_contribution.