4

With subxt is straight-forward as you can access the types by generating them using metadata and use them in your fn arguments but in polkadot.js is kinda not straight forward as where and how the metadata types are being generated and used.

Example,

Referenda.submit() // the arguments are PalletCustomOrigins,DispatchTime,Preimage

1 Answer 1

1

This can be resolved using type augmentation in your codebase first, so '@polkadot/api-augment/<chain>' This augments the types needs to be used inside the functions api ( txn, queries ).

And this gives clarity on what data types needs to be passed as function parameters.

It is straight forward for Kusama and Polkadot chains for custom chains first generate the types from typegen tool.

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.