They are both pronouns . Whatever can also be an adjective, but there is no noun modified by it in your sentences, so it can only be a pronoun. What else can I tell you?
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.