I want to get all the program accounts with a filter. The variable country
is a number in my code and I don't know how to convert it to bytes
for the filtering to work.
const country = 0;
const sellerAccountFilters = {
filters: [
{
dataSize: 198,
},
{
memcmp: {
offset: 8,
// How to convert country from number to bytes ?
bytes: country,
},
},
],
};
const sellerAccount = await connection.getProgramAccounts(programID,filters);
Thanks in advance,