bittensor.core.extrinsics.async_transfer

bittensor.core.extrinsics.async_transfer#

Functions#

_do_transfer(subtensor, wallet, destination, amount[, ...])

Makes transfer from wallet to destination public key address.

transfer_extrinsic(subtensor, wallet, destination, amount)

Transfers funds from this wallet to the destination public key address.

Module Contents#

async bittensor.core.extrinsics.async_transfer._do_transfer(subtensor, wallet, destination, amount, wait_for_inclusion=True, wait_for_finalization=False)#

Makes transfer from wallet to destination public key address.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – initialized AsyncSubtensor object used for transfer

  • wallet (bittensor_wallet.Wallet) – Bittensor wallet object to make transfer from.

  • destination (str) – Destination public key address (ss58_address or ed25519) of recipient.

  • amount (bittensor.utils.balance.Balance) – Amount to stake as Bittensor balance.

  • wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning True, or returns False if the extrinsic fails to enter the block within the timeout.

  • wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning True, or returns False if the extrinsic fails to be finalized within the timeout.

Returns:

success, block hash, formatted error message

Return type:

tuple[bool, str, str]

async bittensor.core.extrinsics.async_transfer.transfer_extrinsic(subtensor, wallet, destination, amount, transfer_all=False, wait_for_inclusion=True, wait_for_finalization=False, keep_alive=True)#

Transfers funds from this wallet to the destination public key address.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – initialized AsyncSubtensor object used for transfer

  • wallet (bittensor_wallet.Wallet) – Bittensor wallet object to make transfer from.

  • destination (str) – Destination public key address (ss58_address or ed25519) of recipient.

  • amount (bittensor.utils.balance.Balance) – Amount to stake as Bittensor balance.

  • transfer_all (bool) – Whether to transfer all funds from this wallet to the destination address.

  • wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning True, or returns False if the extrinsic fails to enter the block within the timeout.

  • wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning True, or returns False if the extrinsic fails to be finalized within the timeout.

  • keep_alive (bool) – If set, keeps the account alive by keeping the balance above the existential deposit.

Returns:

Flag is True if extrinsic was finalized or included in the block. If we did not wait for finalization / inclusion, the response is True, regardless of its inclusion.

Return type:

success (bool)