mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-05-30 03:31:07 +00:00
23 lines
532 B
TypeScript
23 lines
532 B
TypeScript
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { KeyringSectionOption } from './types';
|
|
|
|
import { isUndefined } from '@polkadot/util';
|
|
|
|
export default function createItem (address: string, _name?: string): KeyringSectionOption {
|
|
const name = isUndefined(_name)
|
|
? (
|
|
(address.length > 15)
|
|
? `${address.slice(0, 6)}…${address.slice(-6)}`
|
|
: address
|
|
)
|
|
: _name;
|
|
|
|
return {
|
|
key: address,
|
|
name,
|
|
value: address
|
|
};
|
|
}
|