Files
ui/packages/ui-keyring/src/options/item.ts
T
Tarik Gul caa0ceea23 2025 (#822)
* 2025

* update License
2025-01-03 01:07:08 +02:00

23 lines
533 B
TypeScript

// Copyright 2017-2025 @polkadot/ui-keyring authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { KeyringSectionOption } from './types.js';
import { isUndefined } from '@polkadot/util';
export function createOptionItem (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
};
}