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

Allow api.derive.accounts.identity() to obtain SubIdentities #6066

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

valentinfernandez1
Copy link
Contributor

This PR addresses Issue #5810 by introducing a new subs field to the DeriveAccountRegistration structure, allowing for the retrieval of SubIdentities associated with an account.

Retrieval of SubIdentities:

  • If the account is a primary Identity, its SubIdentities are directly retrieved.
  • If the account is a SubIdentity, the parent account's SubIdentities are retrieved, and the queried account is included in the resulting list.

Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, amazing job just one question

@@ -18,6 +18,7 @@ export interface DeriveAccountRegistration {
matrix?: string | undefined;
other?: Record<string, string> | undefined;
parent?: AccountId | undefined;
subs?: AccountId[] | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the actual type Vec<AccountId> returned from subsResponse[1]; or AccountId[]?

Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a yarn lint as well.

Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@TarikGul TarikGul merged commit 4323c6f into master Jan 14, 2025
4 checks passed
@TarikGul TarikGul deleted the vf/derive-subidentities branch January 14, 2025 20:00
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants