mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-08-06 07:15:40 +00:00
1295c36241
- Fixed TypeScript type assertion issues - Updated imports from api-augment/substrate to api-augment/bizinikiwi - Fixed imgConvert.mjs header and imports - Added @ts-expect-error for runtime-converted types - Fixed all @polkadot copyright headers to @pezkuwi
21 lines
646 B
TypeScript
21 lines
646 B
TypeScript
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { ApiPromise } from '@pezkuwi/api';
|
|
import type { DropdownOptions } from '../../util/types.js';
|
|
|
|
export default function createOptions (api: ApiPromise, filter?: (section: string, method?: string) => boolean): DropdownOptions {
|
|
return Object
|
|
.keys(api.tx)
|
|
.filter((s) =>
|
|
!s.startsWith('$') &&
|
|
(!filter || filter(s))
|
|
)
|
|
.sort()
|
|
.filter((name): number => Object.keys(api.tx[name]).length)
|
|
.map((name): { text: string; value: string } => ({
|
|
text: name,
|
|
value: name
|
|
}));
|
|
}
|