* Bump API/Common (esnext exports) * Bump deps * Adjust * Bumps * Bumps * repository * Update dev * Remove Rococo (for the time being) * script extension
18 lines
506 B
TypeScript
18 lines
506 B
TypeScript
// Copyright 2017-2020 @polkadot/react-components authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import { DropdownOptions } from '../../util/types';
|
|
|
|
import { ApiPromise } from '@polkadot/api';
|
|
|
|
export default function createOptions (api: ApiPromise): DropdownOptions {
|
|
return Object
|
|
.keys(api.consts)
|
|
.sort()
|
|
.filter((name): number => Object.keys(api.consts[name]).length)
|
|
.map((name): { text: string; value: string } => ({
|
|
text: name,
|
|
value: name
|
|
}));
|
|
}
|