TransactionFeePaidWithAlpha

Event v401 → current New #121

Transaction fee was paid in Alpha .

View events on chain

From Chain Metadata

Transaction fee was paid in Alpha. Emitted in addition to `TransactionFeePaid` when the fee payment path is Alpha. `alpha_fee` is the exact Alpha amount deducted.

Event Data

#NameTypeDescription
0
who
AccountId Who account address (hex -> SS58)
1
netuid
u16 Subnet/network identifier (0-65535)
2
alpha_fee
u64 alpha_fee (u64) (RAO -> TAO (/ 10^9))
3
tao_amount
u64 tao_amount (u64) (RAO -> TAO (/ 10^9))

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Subscribe to TransactionFeePaidWithAlpha events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("SubtensorModule") &&
      event.method === "TransactionFeePaidWithAlpha"
    )
    .forEach(({ event }) => {
      console.log("TransactionFeePaidWithAlpha:", event.data.toHuman());
    });
});

Runtime Info

View Source
Pallet Index
7
Event Index
121
First Version
v401
Current Version
v401