diff --git a/packages/api-derive/src/accounts/identity.ts b/packages/api-derive/src/accounts/identity.ts index dc9f6f9895..bc6eb94715 100644 --- a/packages/api-derive/src/accounts/identity.ts +++ b/packages/api-derive/src/accounts/identity.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { Bytes, Data } from '@polkadot/types'; -import type { AccountId } from '@polkadot/types/interfaces'; +import type { Bytes, Data, Struct } from '@polkadot/types'; +import type { AccountId, H160 } from '@polkadot/types/interfaces'; import type { PalletIdentityLegacyIdentityInfo, PalletIdentityRegistration } from '@polkadot/types/lookup'; import type { Option } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; @@ -17,9 +17,26 @@ import { firstMemo, memo } from '../util/index.js'; type IdentityInfoAdditional = PalletIdentityLegacyIdentityInfo['additional'][0]; +interface PeopleIdentityInfo extends Struct { + display: Data; + legal: Data; + web: Data; + matrix: Data; + email: Data; + pgpFingerprint: Option; + image: Data; + twitter: Data; + github: Data; + discord: Data; +} + const UNDEF_HEX = { toHex: () => undefined }; function dataAsString (data: Data): string | undefined { + if (!data) { + return data; + } + return data.isRaw ? u8aToString(data.asRaw.toU8a(true)) : data.isNone @@ -58,13 +75,16 @@ function extractIdentity (identityOfOpt?: Option; export interface DeriveAccountRegistration { + discord?: string | undefined; display?: string | undefined; displayParent?: string | undefined; email?: string | undefined; + github?: string | undefined; image?: string | undefined; legal?: string | undefined; + matrix?: string | undefined; other?: Record | undefined; parent?: AccountId | undefined; pgp?: string | undefined;