I'm using @solana/web3.js
and have this code:
const web3 = require("@solana/web3.js");
const clusterApi = process.env.SOLANA_CLUSTER;
module.exports = {
getConfirmedSignaturesForAddress: async address => {
try {
const connection = new web3.Connection(web3.clusterApiUrl(clusterApi), "confirmed");
const result = await connection.getSignaturesForAddress(address, {
limit: 25
});
return {
tx: result,
status: true
};
} catch (e) {
return {
status: false,
error: e.message
};
}
}
}
And every time I call this function I get this error:
{ status: false, error: 'address.toBase58 is not a function' }
I was trying to send it already converted to Base58, but it just doesn't work. What's wrong?