Hmm, not quite sure what you're asking, mate. A txid and an npub are two different things.
A txid is a transaction ID - it's like a receipt for each Bitcoin transaction. It helps you track where your money's going on the blockchain.
An npub or public key is more like your account number in the Bitcoin world. It's what people use to send you bitcoins.
As far as I know, there isn't a way to convert one into the other because they serve totally different purposes!