ghost-portal/packages/react-components/src/InputExtrinsic/options/section.ts
Jaco Greeff a0b82d88a4
Use import type { ... } (#4052)
* Use import type { ... }

* value imports

* TypeDefInfo

* Apply suggestions from code review

* fixes... am going blind.
2020-11-19 16:20:14 +01:00

18 lines
503 B
TypeScript

// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DropdownOptions } from '../../util/types';
import { ApiPromise } from '@polkadot/api';
export default function createOptions (api: ApiPromise): DropdownOptions {
return Object
.keys(api.tx)
.sort()
.filter((name): number => Object.keys(api.tx[name]).length)
.map((name): { text: string; value: string } => ({
text: name,
value: name
}));
}