ghost-portal/packages/ui-react-app/src/InputStorage/options/section.js
Jaco Greeff 724e1e1b3d
Basic parameter passing with storage (#28)
* Basic parameter passing with storage

* Add GH link

* Cleanup param formatting
2018-05-07 17:36:32 +02:00

29 lines
733 B
JavaScript

// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// @flow
import map from '@polkadot/storage-substrate/keys';
export default function createOptions (): Array<*> {
return Object
.keys(map)
.sort()
.filter((name) => {
const { isDeprecated = false, keys } = map[name];
const methods = Object
.keys(keys)
.filter((name) => {
const { isDeprecated = false, isHidden = false } = keys[name];
return !isDeprecated && !isHidden;
});
return !isDeprecated && methods.length !== 0;
})
.map((name) => ({
text: name,
value: name
}));
}