Skip to main content
8 votes
Accepted

What are type bundles and versioned metadata?

First the good news - for any chain using metadata v14, specifying custom types are not needed. The metadata itself supplies all the types required. This means that when a call is defined in the ...
Jaco's user avatar
  • 5,865
5 votes

Creating offline transaction for parachains

Great question, So txwrapper-core was developed with the idea that we would expose all the tools necessary for individuals to build their own offline tx construction libraries. In your case the best ...
Tarik Gul's user avatar
  • 1,131
5 votes
Accepted

How does typegen work with metadata v14?

You are correct in that the actual definitions are basically deprecated. However, it does still play a (small) role in that the RPC types are not carried in the metadata. (This will change in the ...
Jaco's user avatar
  • 5,865
4 votes
Accepted

api.createType does not work?

The XcmVersionedMultiLocation type-example you shared can be created as follows : const loc = api.createType("XcmVersionedMultiLocation", { V3: { ...
dominique's user avatar
  • 1,693
4 votes

js polkadot/api reading objects from the chain

As of metadata v14 you don't need to pass any type definitions - the runtime metadata fully specifies all objects and the API will use these type definitions. In general, there are a couple of to* ...
Jaco's user avatar
  • 5,865
4 votes

help: when update the substrate 4.0 custom type json file

With the current master Substrate versions (and all chains that are recent **), there is no need for specific type injections, nor are there any specific external type bundles. Since metadata v14 was ...
Werner S's user avatar
  • 629
3 votes
Accepted

RPC full type specification from metadata

This is definitely a feature we have in mind, however at the moment there are no plans to implement it in the immediate future. I have created an issue for it in Substrate: https://github.com/...
Andrew Jones's user avatar
2 votes
Accepted

Substrate Sidecar Custom Type Issue

Geez... remove the outer types property so just have: { "AccountInfo": "AccountInfoWithRefCount" } And everything works... maybe this will help someone else.
Will White's user avatar
2 votes
Accepted

Custom ChargeTransactionPayment type for extrinsics

Yes this is absolutely possible to inject types into polkadot-js api. When instantiating an ApiPromise, you may also pass in one of the following: { types, typesAlias typesBundle, ...
Tarik Gul's user avatar
  • 1,131
2 votes

How to make an RPC call from a working custom RPC, decorate types and display info successfully?

Seems like it's an issue with the runtime, not in front-end. //rpc/src/lib.rs fn list_members( &self, supersig_account: AccountId, at: Option<<Block as BlockT>::Hash>, ) -&...
cuteolaf's user avatar
  • 103
2 votes
Accepted

Add my custom chain types to Polkadot-js/apps

In the Usage section of the Polkadot.js typegen tutorial it first shows how to extract the types from your custom type definitions, for example see how the Edgeware team releases versions their types ...
Luke Schoen's user avatar
  • 2,346
1 vote

How do you use subxt without having to use the re-exported types?

The solution was to use the substitute_type macro argument, as shown below: #[subxt::subxt(runtime_metadata_path = "entropy_metadata.scale")] pub mod entropy { #[subxt::subxt(...
Jake Hemmerle's user avatar
1 vote

frame_benchmarking convert Vec to BoundedVec

Okay after all of that, I managed to figure it out... Since frame_benchmarking::Vec<u8> wasn't working I decided to focus on converting a BoundedVec to the custom type. Firstly I needed to add ...
DJJ's user avatar
  • 63
1 vote
Accepted

How to generate augmented types from V14 metadata generated with subwasm

The latest release of subwasm contains a flag --format=json+scale which will return exactly the {"result": "<scale and hex encoded metadata>"} that is needed.
Tino Rusch's user avatar
1 vote
Accepted

Error: Expected associated type but found enum. I'm getting this error even after defining the associated type as a custom enum in the mock runtime

You can add a where_clause to your benchmarks which allows to enforce that associated types from the pallet's config are some particular concrete types. I believe something along this lines should ...
Adam Wierzbicki's user avatar
1 vote

Custom type is encoded as Bytes

I am afraid you can't do this. The TypeInfo will explain this type as BoundedVec<u8, MaxGenericIdLenGet>. So, it shows bytes in the PolkadotApps. Why H256 work? In fact, H256 is [u8; 32]. But ...
AurevoirXavier's user avatar
  • 10.7k
1 vote

Custom block header definition ignored by polkadot ui

I checked the current apps UI against these chains. As explained in the comment above, it seems to have indeed been a misconfiguration when the chain was added on the UI - the types were not mapped on ...
RosaryBeads's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible