Here it is, we have a account list when create TransactionInstruction. So the list could have a random order? or it must follow some specific order?
const keys = [
{
pubkey: key1,
isSigner: true,
isWritable: true,
},
{
pubkey: key2,
isSigner: false,
isWritable: true,
},
...
];
new TransactionInstruction({
keys,
programId: PROGRAM_ID,
data: txnData,
}),