Skip to main content

Questions tagged [custom-types]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
islami00's user avatar
  • 561
6 votes
1 answer
98 views

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

We are building a custom UI for chains containing a specific custom pallet and rpc module. The custom UI is similar to a polkadot-js clone we built, but much simpler. In our simple custom UI, we are ...
Ramsey - Decentration's user avatar
4 votes
2 answers
129 views

RPC full type specification from metadata

Since metadata v14 and scale-info were introduced, the runtime fully specifies all runtime interfaces and types. On the RPC side however the rpc_methods only returns the list of methods exposed, ...
Xiu Hung's user avatar
  • 527
4 votes
1 answer
93 views

Custom block header definition ignored by polkadot ui

in Mangata we run into some problems when integrating polkadot-ui with our chain. For most of the time we use older polkadot.js apps v0.96.1 - that version allows for types definition injection using ...
mat13mn's user avatar
  • 41
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 ...
islami00's user avatar
  • 561
3 votes
0 answers
95 views

Custom typegen and using ApiPromise: Property 'unwrap' does not exist on type 'Codec'

It seems there is a mismatch between autocomplete suggestion return types from an ApiPromise instance and the actual returned type. I am using "@polkadot/api": "8.1.1". I am ...
Nepoche's user avatar
  • 83
2 votes
1 answer
120 views

Creating offline transaction for parachains

From my research of how to generate and sign transactions offline I found docs: https://wiki.polkadot.network/docs/build-transaction-construction citing txwrapper-core: https://github.com/paritytech/...
Tadej Vengust's user avatar
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 ...
Michal Danco's user avatar
1 vote
1 answer
167 views

js polkadot/api reading objects from the chain

Could you please tell me how convert a queryResult from Substrate storage into js object? i use these two functions to get the object from chain into js object queryResult.toHuman() function, but it ...
cocokick's user avatar
  • 165
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/...
Discardo's user avatar
  • 436
1 vote
1 answer
127 views

Custom ChargeTransactionPayment type for extrinsics

if the type for extrinsic verification pub struct ChargeTransactionPayment<T: Config> has been changed on a chain, how do we update the polkadot.js API to use the new types? Suppose the type has ...
Emmanuel Thomas's user avatar
1 vote
1 answer
84 views

How to generate augmented types from V14 metadata generated with subwasm

The common way of generated type augmentation is by fetching the latest metadata from a running node with the following piece of code: await provider.connect() await provider.isReady const result = ...
Antonio Antonino's user avatar
1 vote
1 answer
50 views

Display type alias for primitive types

I have observed few pallets have type alias for primitive types for chain state. For eg- Grandpa pallet has one storage setIdSession which shows type as SetId even though its primitive type is u64. ...
Siddharth Teli's user avatar
1 vote
0 answers
29 views

Add custom type to the substrate-front-end-template

is it a new approach to add the custom types to the substrate-front-end-template ? the ones I found in past examples of Kitties seem don't work any more. I try adding them to the PolkadotJS and to the ...
M M's user avatar
  • 11
0 votes
1 answer
32 views

help: when update the substrate 4.0 custom type json file [closed]

I haven't found the custom type JSON file on GitHub, where can I download it
Abel's user avatar
  • 61
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 ...
Will White's user avatar
0 votes
1 answer
57 views

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

Answering my own question here, but I had an issue where I had a shared Rust library (entropy-shared) with types that were shared between a Rust binary using subxt and some Substrate pallets it ...
Jake Hemmerle's user avatar
0 votes
1 answer
58 views

frame_benchmarking convert Vec to BoundedVec

I am unable to get benchmarks to work after changing an extrinsic argument from Vec<u8> to a custom type which is a BoundedVec defined in the pallet pallets config. Can someone provide me with ...
DJJ's user avatar
  • 63
0 votes
2 answers
104 views

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

I'm trying to run the following benchmark test: use primitives::{CurrencyId, TokenId}; benchmarks! { onboard_asset { let caller: T::AccountId = whitelisted_caller(); let ...
AKASH S M's user avatar
0 votes
1 answer
43 views

Custom type is encoded as Bytes

In my pallet have created a custom new-type, in the same fashion as AccountId32: #[derive(Encode, Decode, Clone, PartialEq, Eq, Ord, PartialOrd, Debug, MaxEncodedLen, TypeInfo)] pub struct GenericId(...
digital illusion's user avatar
0 votes
0 answers
27 views

generate types from chain does not work. Documentation is not clear

I dont think typegen is working as expected per documentation, by following the provided example and adapting it to my parachain. ` Found 244 errors in 5 files. Errors Files 5 src/interfaces/augment-...
rvalle's user avatar
  • 45
0 votes
0 answers
13 views

Does Substrate support custom node specific environment vars or flags

I have a pallet that should have access to a secp256k1::Keypair for signing messages. And I want to be able to start the node with either the secret_key string or a path to a key-file. Then have the ...
ambiguous omen's user avatar
0 votes
0 answers
177 views

Polkadot Explorer: decode storage system.events

I was doing some testing and sent a transaction on a custom substrate chain. On the polkadot explorer, the block which held the transaction had an error. The transaction completed; however, the ...
cboo's user avatar
  • 1