ProxyAdded

Event v149 → v323, v326 → current #4

Emitted when a new proxy is registered for an account.

View events on chain
Useful for: stakersvalidatorsdeveloperswalletsanalytics

The Big Picture

Signals that an account has granted proxy permissions to another.

Use Cases

  • Track when proxy permissions are granted

From Chain Metadata

A proxy was added.

Triggers

Emitted by

Preconditions

  • Sufficient deposit
  • MaxProxies not exceeded

Effects

Storage Modified

Postconditions

  • Proxy relationship created
  • Deposit reserved

Event Data

#NameTypeDescription
0
delegator
AccountId Account that delegated proxy permission (hex -> SS58)
1
delegatee
AccountId Account receiving proxy permission (hex -> SS58)
2
proxy_type
ProxyType Type of proxy permission granted
3
delay
u32 BlockNumberFor<T>Number of blocks before proxy can execute (0 = immediate)

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 ProxyAdded events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Proxy.ProxyAdded.get(block.hash);
  for (const evt of events) {
    console.log("ProxyAdded:", evt.payload);
  }
});

Version History

v149 block 3,014,339 4 args
v326 block 6,608,228 4 args Current

Runtime Info

Pallet Index
16
Event Index
4
First Version
v149
Current Version
v411