ghost-portal/packages/react-components/src/util/getSiName.ts
Jaco 829830b83a
Adjust query type display (#6150)
* Adjust query type display

* linting

* Fix test page
2021-09-19 17:58:56 +02:00

11 lines
374 B
TypeScript

// Copyright 2017-2021 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { PortableRegistry, SiLookupTypeId } from '@polkadot/types/interfaces';
export function getSiName (lookup: PortableRegistry, type: SiLookupTypeId): string {
const typeDef = lookup.getTypeDef(type);
return typeDef.lookupName || typeDef.type;
}