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 = await api.rpc.chain.getHeader();
        let currentBlockNumber = currentHeader.number;
        let currentBlockHash = currentHeader.hash;
        console.log("currentBlockNumber=" + currentBlockNumber);
        console.log("currentBlockHash=" + currentBlockHash);

        let queryResult = await api.query.mypallet.mystorage.entries(); // ??????????

How can I do it?

2 Answers 2


Did you try await api.query.mypallet.mystorage.entriesAt(blockHash)?

The method entriesAt is defined here

  • Thank you! However, VSCode is telling me that entriesAt() has been deprecated. Jul 14, 2023 at 17:47

The entriesAt() function has been deprecated so the correct way to do this is to get a separate instance of the api at the specified block hash.

const apiAtBlockHash = await this.api.at(blockHash);
let queryResult = await apiAtBlockHash.query.mypallet.mystorage.entries();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.