Queries
gamma-spent
The gamma a hotkey has spent at a service on a subnet, as an exact decimal string.
It only grows, until the subnet is dissolved, which clears it. A service crediting spends
reads it at a finalized block:
(await client.at(await client.finalized_block())).gamma.gamma_spent(...).
Category: Gamma
Parameters
| Parameter | Type | Description |
|---|---|---|
netuid | integer | Subnet of the service. |
service_hotkey_ss58 | string | Hotkey of the service. |
hotkey_ss58 | string | Hotkey that spent. |
CLI
btcli query gamma-spent --netuid <integer> --service-hotkey <ss58|name> --hotkey <ss58|name> --jsonPython
Namespace method (autocomplete, signature help):
import bittensor as bt
sub = bt.Subtensor()
result = sub.gamma.gamma_spent(netuid=1, service_hotkey_ss58="5F...", hotkey_ss58="5F...")Or dispatch by name, as an agent would:
result = sub.read("gamma_spent", netuid=1, service_hotkey_ss58="5F...", hotkey_ss58="5F...")Async is the same surface awaited: async with bt.Subtensor() as client:.
On-chain implementation
- Storage
SubtensorModule.GammaSpent
Every file is browsable under /code exactly as built into the runtime.