AddStakeBurn
Event v385 → v385, v391 → v402, v411 → current Changed in v411 #120"Add stake and burn " event : alpha token was purchased and burned.
View events on chainFrom Chain Metadata
"Add stake and burn" event: alpha token was purchased and burned.
Triggers
Emitted by
May fail with
NotEnoughStaketoWithdrawNotEnoughStakeNotEnoughStakeToWithdrawNotEnoughStakeToSetWeightsStakeToWithdrawIsZeroNotEnoughStakeToSetChildkeysNotEnoughBalanceToStakeStakeAlreadyAddedStakeRateLimitExceededUnstakeRateLimitExceededStakeTooLowForRootBelowStakeThresholdNomStakeBelowMinimumThresholdCannotUnstakeLockStakeUnavailableZeroMaxStakeAmountSameAutoStakeHotkeyAlreadySetAddStakeBurnRateLimitExceededInsufficientStakeForLock
Effects
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | netuid | u16 NetUid | netuid: Subnet ID (u16, 0-65535) |
| 1 | hotkey | AccountId | hotkey: Account address (32 bytes, SS58-encoded) (hex -> SS58) |
| 2 | amount | u64 TaoBalance | amount: TAO amount in RAO (÷10⁹ for TAO) (RAO -> TAO (/ 10^9)) |
| 3 | alpha | u64 AlphaBalance | alpha: Alpha amount in alpha-RAO (÷10⁹ for alpha) (RAO -> TAO (/ 10^9)) |
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Subscribe to AddStakeBurn events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.SubtensorModule.AddStakeBurn.get(block.hash);
for (const evt of events) {
console.log("AddStakeBurn:", evt.payload);
}
});Version History
v385 block 7,782,670 4 args
v391 block 7,782,857 4 args
v411 block 8,283,784 4 args Current
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 120
- First Version
- v385
- Current Version
- v411