Skip to main content

Questions tagged [types]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
33 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 ...
0 votes
2 answers
128 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, ...
1 vote
0 answers
12 views

How to check type info in substrate?

I want to debug and check if the variable has my expected type or not. So how do I debug and print out the type?
0 votes
1 answer
33 views

facing unconstrained type parameter issue

I'm using fresh node template and trying to implement below code: #[pallet::storage] pub type Author<T: Config> = StorageValue<_, sr25519::Public, OptionQuery>; pub struct ...
1 vote
1 answer
121 views

How can you use Polkadot JS API to Create an XCM Reserve Transfer Assets? (XCM V2)

I am trying to create a reserve transfer assets call from a relay chain like Kusama to a Parachain. To do this, I need to: connect to the relay chain with Polkadot JS API construct the XCM types ...
1 vote
1 answer
65 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: ...
1 vote
1 answer
35 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(&...
2 votes
1 answer
82 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 ...
3 votes
1 answer
20 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,&...
0 votes
1 answer
25 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 ...
1 vote
1 answer
226 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/...
2 votes
1 answer
129 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 = { ...
1 vote
1 answer
74 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::...
0 votes
1 answer
55 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, ...
5 votes
1 answer
768 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 ...
3 votes
0 answers
68 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: ...
1 vote
0 answers
42 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 ...
4 votes
2 answers
136 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 ...
3 votes
1 answer
144 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 ...
9 votes
1 answer
162 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 ...
3 votes
1 answer
113 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>:...
0 votes
1 answer
50 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 ...