diff --git a/packages/page-preimages/src/usePreimage.ts b/packages/page-preimages/src/usePreimage.ts index 2964c2a7d5..6f3f2439f2 100644 --- a/packages/page-preimages/src/usePreimage.ts +++ b/packages/page-preimages/src/usePreimage.ts @@ -82,8 +82,11 @@ function usePreimageImpl (hashOrBounded?: Hash | HexString | FrameSupportPreimag const { api } = useApi(); const hash = useMemo( - () => hashOrBounded && getPreimageHash(hashOrBounded), - [hashOrBounded] + // we need a hash _and_ be on the newest supported version of the pallet + // (after the application of bounded calls) + () => api.query.preimage?.preimageFor?.creator.meta.type.isMap && api.registry.lookup.getTypeDef(api.query.preimage.preimageFor.creator.meta.type.asMap.key).type === '(H256,u32)' && hashOrBounded && + getPreimageHash(hashOrBounded), + [api, hashOrBounded] ); const optStatus = useCall>(hash && api.query.preimage?.statusFor, [hash]);