Questions tagged [types]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 views

Generated Types Not Found

Hi we are following along with the typegen docs on polkadotjs documentation. and the generated code cannot find most the types. an example line: Called: AugmentedEvent<ApiType, [caller: ...
donkeydonkey's user avatar
1 vote
1 answer
24 views

Polkadot JS query response types are missing

No types for blockchain query responses are available in our IDE. Doing any query like this await blockchain.api.query.assets.asset(id, (res) => { const info = res.toJSON() console.log(&...
donkeydonkey's user avatar
2 votes
1 answer
70 views

api.createType does not work?

I would like to create a type called XcmVersionedMultiLocation. It can be imported using the following code: import { XcmVersionedMultiLocation } from "@polkadot/types/lookup"; To create an ...
Michal Danco's user avatar
3 votes
1 answer
19 views

Property X does not exist on type DecoratedRpc

We are currently experiencing an issue related to RPC methods. Let me provide a description of the problem: To generate metadata from our node, we use the following command: echo '{"id":1,&...
Michal Danco's user avatar
0 votes
1 answer
24 views

what is the correct typescript syntax for declaring the return type of session.queuedKeys()

in this pull request, i attempt to add support for looking up the collator account associated with a given nimbus session key. the method implementation in the pr is as follows: export function ...
grenade's user avatar
  • 456
0 votes
1 answer
28 views

Multiple test mock runtimes with slightly different configs based off common base?

We have some custom pallet unit tests that use multiple mock runtimes that are configured slightly differently. The problem is that when we have to make changes to the runtime, we have to apply those ...
Robert La Ferla's user avatar
1 vote
1 answer
159 views

Add my custom chain types to Polkadot-js/apps

I want to add my chain types to the Polkadot-js/apps in order to reflect the changes on frontend. I've tried generating types using this tutorial, but I've no idea how can I use them in Polkadot-js/...
Discardo's user avatar
  • 382
2 votes
1 answer
105 views

MultiLocation type polkadot js

I am trying to figure out correct way how to type MultiLocation type I thought that I would do import {MultiLocation} from "@polkadot/types/interfaces" const location: MultiLocation = { ...
Michal Danco's user avatar
0 votes
1 answer
113 views

Custom RPC sized array parameters

I have custom RPC, which looks like so #[rpc(client, server)] pub trait SomeRpcApi { #[method(name = "some_submitData")] async fn submit_data( &self, id: u64, ...
Ivan Temchenko's user avatar
1 vote
1 answer
60 views

How can i resolve this weird error with StorageMap implementation?

I am trying to upgrade pallet-did to substrate v4 but i have an issue am facing with the StorageMap implementation. Below is the code for the storage map functions i am trying to implement: #[pallet::...
master chief's user avatar
0 votes
1 answer
44 views

impl<T: Config> unconstrained type parameter

Struct #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, TypeInfo)] #[cfg_attr(feature = "std", derive(Debug))] pub struct Post<PostId, AccountId> { pub id: PostId, ...
Amiya Behera's user avatar
3 votes
0 answers
58 views

Updating AssetId when using pallet_assets

I am trying to use the pallet_asset, but the AssetId type is giving me some trouble. Try nbr.1: Create a storage value TokenId that takes a u32 Create the AssetId from the u32 inside the storage: ...
Kazunobu Ndong's user avatar
1 vote
0 answers
38 views

how to get type registry for substrate v4.0.0 parachain?

so i have a parachain upgraded to substrate 4.0.0 and i need the type registry of this chain in order to work with subscan-essentials normally with substrate-node-template subscan-essentials work ...
Rahul navgire's user avatar
4 votes
2 answers
125 views

Correct way to use dynamic sized types in chain extension

I'm writing chain extensions for my pallets and I have a few functions that require dynamic sized types, for example Vec<u8> for metadata and Vec<u64> for a list of asset ids. The way I am ...
Gabe's user avatar
  • 115
3 votes
1 answer
128 views

How does typegen work with metadata v14?

In the new metadata v14, a types.json is no longer required for custom types. How does this affect the typegen procedure in the docs which require us to specify these types in the definition.ts for ...
islami00's user avatar
  • 561
9 votes
1 answer
127 views

What are type bundles and versioned metadata?

I was exploring typegen for my node's custom types and came across these two concepts in the acala.js codebase in the type-definitions package (their use of a "types-bundle.json"), and ...
islami00's user avatar
  • 561
3 votes
1 answer
104 views

Why can't we use `T::Call` in pallet like `T::AccountId` and `T::BlockNumber`?

I am trying to use T::Call (This type is defined in frame_system) in storage and pallet dispatchable functions but getting below error. error[E0277]: the trait bound `<T as frame_system::Config>:...
Ayush Mishra's user avatar
5 votes
1 answer
603 views

Cannot infer type for type parameter 'T'

I have a function using the following 2 types: pub type BalanceOf<T> = <<T as pallet::Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance; pub ...
Kazunobu Ndong's user avatar
0 votes
1 answer
43 views

Substrate Sidecar Custom Type Issue

I'm wiring up the substrate sidecar to a chain which has some custom type and some out of date types (as compared to current) such as AccountInfo. I've found that it uses the older ...
Will White's user avatar