diff --git a/packages/ui-params/src/Param/findComponent.ts b/packages/ui-params/src/Param/findComponent.ts index 5d7be0d928..7fc3f9ef4d 100644 --- a/packages/ui-params/src/Param/findComponent.ts +++ b/packages/ui-params/src/Param/findComponent.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { TypeDef, TypeDefInfo } from '@polkadot/types'; +import { TypeDef, TypeDefInfo, UInt, createType } from '@polkadot/types'; import { Props, ComponentMap } from '../types'; import Account from './Account'; @@ -72,5 +72,15 @@ export default function findComponent (def: TypeDef, overrides: ComponentMap = { } })(def); - return overrides[type] || components[type] || Unknown; + let Component = overrides[type] || components[type]; + + if (!Component) { + const instance = createType(type); + + if (instance instanceof UInt) { + return Amount; + } + } + + return Component || Unknown; } diff --git a/packages/ui-params/src/initValue.ts b/packages/ui-params/src/initValue.ts index 8e021b569f..7a79c6ebb5 100644 --- a/packages/ui-params/src/initValue.ts +++ b/packages/ui-params/src/initValue.ts @@ -5,7 +5,7 @@ import { RawParam$Value } from './types'; import BN from 'bn.js'; -import { Bytes, Hash, TypeDef, TypeDefInfo } from '@polkadot/types'; +import { Bytes, Hash, TypeDef, TypeDefInfo, UInt, createType } from '@polkadot/types'; export default function getInitValue (def: TypeDef): RawParam$Value | Array { if (def.info === TypeDefInfo.Vector) { @@ -78,8 +78,15 @@ export default function getInitValue (def: TypeDef): RawParam$Value | Array