0

As we can see in polkadotjs, when we add pallet then we can see interaction interface as shown in image below. But how this code is generated? Where can I find the code?

enter image description here

1 Answer 1

1

The code for the pallet specifically is not in JavaScript, it is written in Rust. The code for this UI is located in this repo. The pallets emit type metadata that components in the apps repo utilize to construct the UIs you are using.

2
  • hey @Drew Stone thanks for this information. I review page-nfts code but haven't found create() function and haven't found any parameters which are passed inside create() function.
    – Ganesh11
    Jul 27 at 3:24
  • It's because you're actually on page-extrinsics. And as mentioned, you might find that a lot of this logic is automatically (magically) generated from the type metadata. These extrinsic calls especially. It's just one giant data (JSON) blob that says what pallets have what extrinsic calls/state calls/rpc calls, etc.
    – Drew Stone
    Jul 27 at 17:43

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.