Transactions
transfer-gamma
Send gamma on a subnet to another coldkey.
Sends exactly amount_gamma from your gamma balance, or your deposit at
origin_hotkey_ss58, to the gamma balance of dest_coldkey_ss58, or
its deposit at destination_hotkey_ss58, opening one with no daily spend
cap if there is none: only at a hotkey no other coldkey owns, and while the
receiver holds fewer than 32 deposits across subnets and has no coldkey swap
underway. The amount is at least 0.1 gamma, leaving none or at least as
much. A transfer that empties your deposit closes it.
| Signer | Origin | Pallet | Wraps |
|---|---|---|---|
coldkey | signed account (pallet role may apply) | SubtensorModule | SubtensorModule.transfer_gamma |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
netuid | integer | yes | Subnet of the gamma. |
dest_coldkey_ss58 | string | yes | Coldkey receiving the gamma. |
amount_gamma | number | yes | Gamma sent. |
origin_hotkey_ss58 | string | no | Hotkey of your deposit to send from. Omit to send from your balance. |
destination_hotkey_ss58 | string | no | Hotkey of the receiver's deposit to credit, which that hotkey spends under the deposit's daily spend cap, or opens with none. Omit to credit its balance, which its coldkey must deposit first. |
Address parameters (--hotkey, --coldkey, --dest, ...) accept a raw ss58
address, an address-book or proxy-book name, or a local wallet/hotkey name.
CLI
Preview with --dry-run (shows fee, effects, and policy result without
submitting), then submit:
btcli tx transfer-gamma \
--netuid <int> \
--dest-coldkey <ss58|name> \
--amount-gamma <amount> --dry-run
btcli tx transfer-gamma \
--netuid <int> \
--dest-coldkey <ss58|name> \
--amount-gamma <amount> -w my_coldkeyPython
import bittensor as bt
from bittensor.wallet import Wallet
wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.TransferGamma(netuid=1, dest_coldkey_ss58="5G...destination", amount_gamma=1.0)
sub = bt.Subtensor()
plan = sub.plan(intent, wallet) # fee, effects, policy — no submission
result = sub.execute(intent, wallet)
if not result.success:
print(result.error.code, result.error.remediation)(bt.Subtensor is also the async client — async with bt.Subtensor() as client:
— see The client.) Or build the intent by op name, as
an agent would:
result = sub.execute_tool("transfer_gamma", {...}, wallet)On-chain implementation
SubtensorModule.transfer_gamma — pallets/subtensor/src/macros/dispatches.rs#L3330:
#[pallet::call_index(177)]
#[pallet::weight((Pallet::<T>::transfer_gamma_weight(destination_hotkey.is_some()), DispatchClass::Normal, Pays::Yes))]
pub fn transfer_gamma(
origin: OriginFor<T>,
destination_coldkey: T::AccountId,
origin_hotkey: Option<T::AccountId>,
destination_hotkey: Option<T::AccountId>,
netuid: NetUid,
amount: GammaBalance,
) -> DispatchResult {
Self::do_transfer_gamma(
origin,
destination_coldkey,
origin_hotkey,
destination_hotkey,
netuid,
amount,
)
}Delegates to do_transfer_gamma.
Every file is browsable under /code exactly as built into the runtime, or as plain text under /code/raw/<path> (index: /code/index.json).