5

Currently, polkadot-js doesn't allow me to select a unit when specifying balances in the Developer > Extrinsics section, which means that all balances must be specified in the smallest unit (10^12 is one KSM, etc.). So instead of just transfering 1 KSM, I'm now sending 1,000,000,000,000 Planck. This is very inconvenient, and it used to be different, as seen in this screenshot:

enter image description here

Is this a metadata problem? Is it possible to configure polkadot-js to at least use the standard unit (KSM, DOT, etc.)?

Edit. So running polkadot --chain=kusama --tmp on the master branch of the Polkadot repository still has units for extrinsics like transfer (also works with mainnet, westend, etc.), but when using polkadot --dev --tmp, units are disabled. When connecting with Kusama via the polkadot-js browser plugin, units are disabled. What's going on here?

It seems very much like this behavior is still available and can be activated using some kind of chain configuration.

2 Answers 2

2
+50

With metadata V14, PolkadotJS does not support units. see polkadot-js/apps#6347

3

The Developer > Extrinsics section is just a raw generation of the extrinsics available by a runtime.

It even exposes the raw type to the end user, which it expects the user to use:

enter image description here

Note that the type name Balance could really mean anything. I could create an extrinsic with a type Balance which is a bool and means if a scale is balanced or not, or a percentage describing the "balance of the Force".

So your assumption that the Developer > Extrinsics section should be "smart enough" to present different units of balances is misguided I think. In every spot that an intentional UI was designed with the concept of user token balances, this UNIT selector is present:

enter image description here

The Polkadot JS Apps developer section is meant to be a developer toolkit, and thus has not introduced any "user friendly" assumptions, since those assumptions could be fundamentally wrong.

Instead it presents only the raw data and inputs, which are guaranteed to always be correct in the context of this section.

5
  • 1
    I've updated the question. The screenshot shows that it used to be possible to add use different units for certain parameters. So my question still stands: Is this still possible, and if so, then how? Or was this made impossible by some update of polkadot?
    – mkl
    Feb 12, 2022 at 19:47
  • By the way, I never suggested that the developer tool kit should make any assumption about whether or not units for tokens balances apply to parameters of extrinsics. I think it would be perfectly fine to just mark an extrinsics metadata accordingly. And I suspect that this was how it used to work.
    – mkl
    Feb 12, 2022 at 19:50
  • 2
    I see the "raw" value in the Developer > Extrinsics section. But I see the UX downside there too. As improving the whole section wouldn't be that easy/straightforward I would recommend to keep an eye on the extrinsics.io treasury proposal here, that aims to do that in a new web tool. Feb 13, 2022 at 14:32
  • @ArturGontijo Thanks for pointing that out. Depending on what node you run, you sometimes get the raw value, sometimes the unified (?) value. At this point, I'm not even sure this is expected behavior.
    – mkl
    Feb 13, 2022 at 14:42
  • @mkl yeah, you're right and that's odd. I don't know how PolkadotJS fetches the data to render the Developer > Extrinsics form but Shawn would be our best shot here =). Feb 13, 2022 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.