|  | 
| 1 | 1 | import { ApiPromise } from '@polkadot/api' | 
| 2 |  | -import { Data } from '@polkadot/types' | 
|  | 2 | +// import { Data } from '@polkadot/types' | 
| 3 | 3 | import { AccountId } from '@polkadot/types/interfaces' | 
| 4 | 4 | import '@polkadot/api-augment/substrate' | 
| 5 |  | -import { PalletIdentityIdentityInfo } from '@polkadot/types/lookup' | 
| 6 |  | -import { u8aToBuffer } from '@polkadot/util' | 
|  | 5 | +// import { PalletIdentityLegacyIdentityInfo } from '@polkadot/types/lookup' | 
|  | 6 | +// import { u8aToBuffer } from '@polkadot/util' | 
| 7 | 7 | 
 | 
| 8 | 8 | export async function fetchMemberDetails(api: ApiPromise, accountId: AccountId): Promise<SocietyMemberDetails> { | 
| 9 | 9 |   const [accountInfo, maybeIdentity] = await Promise.all([ | 
| 10 | 10 |     api.derive.accounts.info(accountId), | 
| 11 | 11 |     api.query.identity.identityOf(accountId) | 
| 12 | 12 |   ]) | 
| 13 | 13 | 
 | 
| 14 |  | -  const identity = maybeIdentity.isSome ? buildAccountIdentity(maybeIdentity.unwrap().info) : undefined | 
|  | 14 | +  const identity = maybeIdentity.isSome ? undefined : undefined // temporary until we integrate people's chain | 
| 15 | 15 | 
 | 
| 16 | 16 |   const rawIndex = accountInfo?.accountIndex | 
| 17 | 17 |   const index = rawIndex ? api.registry.createType('AccountIndex', rawIndex.toNumber()).toString() : undefined | 
| 18 | 18 | 
 | 
| 19 | 19 |   return { accountId, identity, index } | 
| 20 | 20 | } | 
| 21 | 21 | 
 | 
| 22 |  | -function buildAccountIdentity(identityInfo: PalletIdentityIdentityInfo): AccountIdentity { | 
| 23 |  | -  return { | 
| 24 |  | -    name: decode(identityInfo.display) ?? '(Unable to get name)', | 
| 25 |  | -    email: decode(identityInfo.email), | 
| 26 |  | -    legal: decode(identityInfo.legal), | 
| 27 |  | -    riot: decode(identityInfo.riot), | 
| 28 |  | -    twitter: decode(identityInfo.twitter), | 
| 29 |  | -    webpage: decode(identityInfo.web) | 
| 30 |  | -  } | 
| 31 |  | -} | 
|  | 22 | +// function buildAccountIdentity(identityInfo: PalletIdentityLegacyIdentityInfo): AccountIdentity { | 
|  | 23 | +//   return { | 
|  | 24 | +//     name: decode(identityInfo.display) ?? '(Unable to get name)', | 
|  | 25 | +//     email: decode(identityInfo.email), | 
|  | 26 | +//     legal: decode(identityInfo.legal), | 
|  | 27 | +//     riot: decode(identityInfo.riot), | 
|  | 28 | +//     twitter: decode(identityInfo.twitter), | 
|  | 29 | +//     webpage: decode(identityInfo.web) | 
|  | 30 | +//   } | 
|  | 31 | +// } | 
| 32 | 32 | 
 | 
| 33 |  | -const decode = (data: Data) => (data.isEmpty ? undefined : u8aToBuffer(data.toU8a()).toString()) | 
|  | 33 | +// const decode = (data: Data) => (data.isEmpty ? undefined : u8aToBuffer(data.toU8a()).toString()) | 
0 commit comments