Skip to main content

Questions tagged [query]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Uncaught runtime errors: [u8;16]:: Expected input with 16 bytes (128 bits), found 21 bytes

I created a value id by this: let encoded_payload = (owner.clone(), task_description.clone()).encode(); let id = frame_support::Hashable::blake2_128(&encoded_payload);// hashvalue of combined ...
MinhK's user avatar
  • 125
3 votes
1 answer
51 views

subscriptions with parameters in polkadot.js api

I am using React+Typescript and trying to retrieve data from a struc using a query subscription. I first tried the following in order to check that I'm retrieving the right data: api.query.rolesModule....
Kazunobu Ndong's user avatar
3 votes
2 answers
75 views

How to perform chain state query for entries AND at a block hash?

I can do this to get all the structs in my storage: let queryResult = await api.query.mypallet.mystorage.entries(); but I want this query AT a specific block hash: let currentHeader = ...
Robert La Ferla's user avatar
3 votes
1 answer
79 views

Build the data bytes to query a contract with the api state_call

I would like to use the rpc call to query a contract. I try to use the method "call" from the endpoint "state" with the first parameter "ContractsApi_call" but I am not ...
GuiGou's user avatar
  • 31
4 votes
1 answer
39 views

Listen to balance changes wrong after transfer token

I'm facing an issue. I used a query subscription to listen and update the free balance on UI. But I don't know why, when I log free in callback, they always return a balance of receiver and then a ...
Tung Le Xuan's user avatar
0 votes
1 answer
64 views

How do you perform a state query in a unit test?

In a custom Substrate pallet unit test, I need to get a list of governance proposals using the chain state. I have used Polkadot JS to query state before but not from within a Substrate unit test in ...
Robert La Ferla's user avatar
1 vote
1 answer
68 views

PolkadotJs Api: queryMulti with different blockHashes

Is it possible to do a multiQuery querying multiple types and multiple blockhashes? Even same type and different block hashes would be helpful. Something along the lines of const multiQueryResult = ...
pifragile's user avatar
2 votes
1 answer
67 views

How to produce empty paramter in an Option?

In the screenshot below the OptionSelect is disabled, which produces info of an array of accounts rather than just one single. How do you replicate this option when curating a call? Using api.query....
Ramsey - Decentration's user avatar
1 vote
1 answer
158 views

how to replace api.rpc.payment.queryInfo in polkadotjs now that it is deprecated?

In https://github.com/polkadot-js/api/releases/tag/v9.8.2 api.rpc.payment.queryInfo is marked as deprecated but how can you build a transaction through polkadotjs without using it?
Luker501's user avatar
5 votes
0 answers
102 views

How can we expose a runtime constant?

I have a situation where I have a constant defined in my runtime (but not in any pallet) which I want to expose with the runtime itself in some way. Specifically, there is a constant used as a ...
notlesh's user avatar
  • 123
1 vote
1 answer
86 views

multi method for api.rpc.chain.getBlockHash does not seem to exist

Could you tell me what is wrong with this code? Is there a way to achieve multiple query? <index.mjs> import { ApiPromise, WsProvider } from '@polkadot/api'; const wsProvider = new WsProvider('...
subsc's user avatar
  • 41
2 votes
1 answer
45 views

When querying storage at a particular block, are the values returned those before or after the execution of the extrinsics in that block?

For example: We have a storage item: Counter that is set to 0. An extrinsic increment in block 11 adds 1 to Counter. If we query for the value of Counter at block 11, do we get 0 or 1?
Kyle's user avatar
  • 311
2 votes
1 answer
126 views

How to write a custom query for storage?

When you declare a storage say pub type Something<T> = StorageValue<_, u32>; We get query function "something". But I want to write some specific functions that reads storage ...
Amiya Behera's user avatar
2 votes
1 answer
50 views

How to use the .multi() method? (substrate-front-end-template)

I finished the substrate kitty tutorial (backend and frontend). Now I would like to build a simple frontend for the RMRK pallet. Now I stuck on the .multi(...) method. Where can I find a documentation ...
SiAlDev's user avatar
  • 91
4 votes
1 answer
161 views

Correlate events with extrinsics in a utility.batch call in Polkadot

In Polkadot and Kusama emitted module events has the phase property so we can correlate them with the extrinsic that triggered that event but I can not do the same when the extrinsic is included in a ...
Mario Pino Uceda's user avatar
2 votes
1 answer
246 views

How to determine which parameters are required when using substrate.query() to query a storage_function from polkascan's py-substrate-interface?

When querying storage functions using Polkascan's py-substrate-interface how do you figure out which parameters are required? For example, I am trying to discern how much KSM is on Karura via storage ...
olliecorbs's user avatar
2 votes
1 answer
84 views

How do you query a list of all previous block hashes from a substrate based chain?

I can see how to do so from the subscan api but I am interested in understanding how to query this data from the chain itself. Ie via a storage function or by another means
olliecorbs's user avatar