diff --git a/packages/type-storage/src/fromMetadata/index.ts b/packages/type-storage/src/fromMetadata/index.ts index 5a998d93fc..02e2ba8b43 100644 --- a/packages/type-storage/src/fromMetadata/index.ts +++ b/packages/type-storage/src/fromMetadata/index.ts @@ -5,7 +5,7 @@ import { ModuleStorage, Storage } from '../types'; import Metadata from '@polkadot/types/Metadata'; -import { stringLowerFirst } from '@polkadot/util'; +import { stringCamelCase, stringLowerFirst } from '@polkadot/util'; import createFunction from './createFunction'; import { storage } from './storage'; @@ -26,7 +26,7 @@ export default function fromMetadata (metadata: Metadata): Storage { const { name, prefix } = moduleMetadata; // For access, we change the index names, i.e. Balances.FreeBalance -> balances.freeBalance - result[stringLowerFirst(name.toString())] = moduleMetadata.storage.unwrap().reduce((newModule, storageFnMeta) => { + result[stringCamelCase(name.toString())] = moduleMetadata.storage.unwrap().reduce((newModule, storageFnMeta) => { newModule[stringLowerFirst(storageFnMeta.name.toString())] = createFunction(prefix, storageFnMeta.name, storageFnMeta); return newModule;