polkadot-js / api

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata.
Apache License 2.0
1.06k stars 343 forks source link

Expose runtime methods from metadata V15 #5725

Open jacogr opened 10 months ago

jacogr commented 10 months ago

Last remaining issue from https://github.com/polkadot-js/api/issues/5633

xlc commented 5 months ago

I only remember one feature from metadata v15 and it is not supported 😢

ntn-x2 commented 4 months ago

Hello @TarikGul! How is this scored in priority compared to other tasks? When can we expect work to be completed on this?

TarikGul commented 3 months ago

Hey @ntn-x2, this is definitely a high priority task. There has just been a big backlog (bugs, reviews etc.), and learning curve with certain workflows especially with all the packages. Things will really start to gain speed soon, and I will have this on the list for next week.

Thanks again for your patience.

ntn-x2 commented 3 months ago

Great, thank you! I will check in with my co-workers if we can support this, since we have digged quite deep already into type augmentation, and having this in and released would greatly benefit us, so we could help out.

TarikGul commented 3 months ago

Okay cool, I've started this and am making some ground. PR should be wrapped up next weekish

rflechtner commented 3 months ago

Okay cool, I've started this and am making some ground. PR should be wrapped up next weekish

Very cool! Will this be covering the typegen as well, so that runtime call interfaces are generated from the metadata without any additional input?

TarikGul commented 3 months ago

Okay cool, I've started this and am making some ground. PR should be wrapped up next weekish

Very cool! Will this be covering the typegen as well, so that runtime call interfaces are generated from the metadata without any additional input?

So my thought to this is a 2 part solution, first the new runtime api's will be added via ./types/*/*/runtime.ts since the runtimes default metadata is still v14.

The following runtime apis to be added:

ValidateStatement
AssetsApi
ContractsApi
AssetConversionApi
NftsApi
MMRApi
    - leafCount

AFAIU the next step will be changing the typegen to be able to read the apis field inside of the metadata itself. This will be a bigger change though as the structure has changed from v14 to v15.