I am trying to make a small public script to fetch the initial minter of a token or a list of tokens.
The easiest way is to fetch the transaction that matches with the correct program id and get the fee payer because, in 99.99% of the cases, the fee payer is the minter itself.
I am trying to get the fee payer from a TransactionResponse object.
I can see that transaction.transaction.message.accountKeys[0]
gives the fee payer but I couldn't find any resource to verify that the first account in accountKeys
array is always the fee payer.
Is this way safe? If not, is there any other convenient way to fetch the fee payer of a transaction?