We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to find the correct way to parse api.call.metadata.metadata() so i can automatically render the "Runtime Calls" for the selected chain.
api.call.metadata.metadata()
I am trying to get the runtime calls from the runtime metadata...
async function fetchRuntimeMetadata(api: ApiPromise) { const metadata = await api.call.metadata.metadata(); const readableMetadata = hexToString(metadata.toString()); console.log('readableMetadata',readableMetadata); return readableMetadata; }
to convert the hex to string i naively flatten the object to a string, which makes it a big challenge to parse...
if i use the above, and try and decode the hex to string, i get this:
runtimeMetdata from queryMetadata: meta� sp_corecrypto,AccountId32 [u8; 32] 0frame_system,AccountInfoNonce,AccountDatanonceNonce$consumers RefCount$providers RefCount,sufficients RefCountdata,AccountData<pallet_balancestypes,AccountDataBalancefreeBalance reservedBalancefrozenBalanceflags(ExtraFlags<pallet_balancestypes(ExtraFlagsu128 4frame_support dispatch@PerDispatchClassT$normal$T,operational$T$mandatory$T$(sp_weights$weight_v2Weight ref_time(u64(proof_size(u64(,,0<primitive_typesH256 [u8; 32]48(sp_runtimegenericdigestDigestlogs<<Vec<DigestItem><@@(sp_runtimegenericdigest(DigestItem(PreRuntimeDDConsensusEngineId4Vec<u8>$ConsensusDDConsensusEngineId4Vec<u8>SealDDConsensusEngineId4Vec<u8>Other4Vec<u8>dRuntimeEnvironmentUpdatedDHLL0frame_system,EventRecordEPT0phase)PhaseeventPEtopics�Vec<T>P@polkadot_runtime0RuntimeEvent�SystemTpframe_system::Event<Runtime>$Scheduler|�pallet_scheduler::Event<Runtime> Preimage�|pallet_preimage::Event<Runtime> Indices�xpallet_indices::Event<Runtime> Balances�|pallet_balances::Event<Runtime>HTransactionPayment��pallet_transaction_payment::Event<Runtime> Staking�xpallet_staking::Event<Runtime> Offences�Xpallet_offences::EventSession�
how can i decode the metadata.metadata so that it is parsable?
Here is also the substrate stack exchange issue.
The text was updated successfully, but these errors were encountered:
@jacogr can you help on this issue?
trying to know the way to parse "Runtime Calls"
Sorry, something went wrong.
No branches or pull requests
I am trying to find the correct way to parse
api.call.metadata.metadata()
so i can automatically render the "Runtime Calls" for the selected chain.I am trying to get the runtime calls from the runtime metadata...
to convert the hex to string i naively flatten the object to a string, which makes it a big challenge to parse...
if i use the above, and try and decode the hex to string, i get this:
how can i decode the metadata.metadata so that it is parsable?
Here is also the substrate stack exchange issue.
The text was updated successfully, but these errors were encountered: