Questions tagged [custom-types]
The custom-types tag has no usage guidance.
23
questions
0
votes
0
answers
13
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-...
0
votes
0
answers
9
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 ...
2
votes
1
answer
71
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 ...
6
votes
1
answer
87
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 ...
1
vote
1
answer
95
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/...
0
votes
1
answer
48
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 ...
0
votes
1
answer
47
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 ...
1
vote
1
answer
161
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/...
1
vote
1
answer
66
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 = ...
1
vote
1
answer
87
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 ...
0
votes
2
answers
85
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 ...
1
vote
1
answer
42
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.
...
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(...
1
vote
1
answer
107
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 ...
1
vote
0
answers
27
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 ...
0
votes
0
answers
144
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 ...
0
votes
1
answer
29
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
3
votes
0
answers
89
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 ...
4
votes
2
answers
118
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, ...
4
votes
1
answer
85
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 ...
3
votes
1
answer
129
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
128
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 ...
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 ...