ghost-portal/packages/page-parachains/src/Overview/util.ts
Jaco Greeff a7b96d0a6f
Parachain proposals (#4372)
* Parachain proposals

* Update

* Retrievae proposals

* Cleanups

* Approved refresh

* Fix Upcoming
2021-01-12 09:48:11 +01:00

11 lines
317 B
TypeScript

// Copyright 2017-2021 @polkadot/app-parachains authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Codec } from '@polkadot/types/types';
export function sliceHex (value: Codec, max: number): string {
const hex = value.toHex();
return `${hex.slice(0, max + 2)}…${hex.slice(-max)}`;
}