Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: query.identity is undefined #5992

Open
3 of 10 tasks
bizk opened this issue Oct 1, 2024 · 2 comments
Open
3 of 10 tasks

BUG: query.identity is undefined #5992

bizk opened this issue Oct 1, 2024 · 2 comments

Comments

@bizk
Copy link

bizk commented Oct 1, 2024

When using query.identity.identityof on typescript. Identity object will be undefined. I tried using older versions of the library 11.x and 12.x and also tried different rpc providers with no luck. Weird because before september this was working just fine.

  • Bug report
  • Feature request
  • Support request
  • Other
  • What is the current behavior and expected behavior?

I expect query.identity not being undefined.

  • Version: 13.x 12.x 11.x

  • Environment: Ubuntu 20.24

    • Node.js: v20.16.0
    • Browser
    • Other (limited support for other environments)
  • Language:

    • JavaScript
    • TypeScript (include tsc --version)
    • Other
@bizk bizk changed the title query.identity is undefined BUG: query.identity is undefined Oct 1, 2024
@bizk
Copy link
Author

bizk commented Oct 1, 2024

Btw here is some sample code to try it out:

  // Connect to the Polkadot network
  const provider = new WsProvider('wss://rpc.polkadot.io'); // You can use other endpoints if needed
  const api = await ApiPromise.create({ provider });

  // Fetch the identity information for the validator
  const { identity } = await api.query.identity.identityOf(validatorAddress);

  // Check if the identity exists
  if (identity && identity.display && identity.display.asRaw) {
    console.log(`Validator ${validatorAddress} has an identity: ${identity.display.asRaw.toString()}`);
  } else {
    console.log(`Validator ${validatorAddress} does not have an identity.`);
  }

  // Disconnect from the API
  await api.disconnect();

@TarikGul
Copy link
Member

TarikGul commented Oct 1, 2024

This is because the identity pallet doesnt exist on Polkadot anymore.

All identity functionality has been moved to the People System Parachain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants