diff --git a/src/polkadot/fellows.ts b/src/polkadot/fellows.ts index c17f270..49f75b8 100644 --- a/src/polkadot/fellows.ts +++ b/src/polkadot/fellows.ts @@ -40,12 +40,9 @@ export class PolkadotFellows implements TeamApi { const users: Map = new Map(); for (const fellow of fellows) { this.logger.debug(`Fetching identity of '${fellow.address}', rank: ${fellow.rank}`); - const fellowData = (await api.query.identity.identityOf(fellow.address)).toHuman() as - | Record - | undefined; - + const identityQuery = await api.query.identity.identityOf(fellow.address); // If the identity is null, we check if there is a super identity. - if (!fellowData) { + if (identityQuery.toHuman() == null) { this.logger.debug("Identity is null. Checking for super identity"); const superIdentity = (await api.query.identity.superOf(fellow.address)).toHuman() as | [string, { Raw: string }] @@ -59,6 +56,8 @@ export class PolkadotFellows implements TeamApi { continue; } + const [fellowData] = identityQuery.toHuman() as [Record, unknown]; + // @ts-ignore const additional = fellowData.info?.additional as [{ Raw: string }, { Raw: string }][] | undefined;