const { Api, JsonRpc } = require('eosjs');
const fetch = require('node-fetch');
const rpc = new JsonRpc('https://api.jungle.alohaeos.com:443', { fetch });
let validAccounts =await rpc.history_get_key_accounts(pubkey)
console.log(validAccounts)
I'm getting output as: { account_names: [] } But the account does exist for the public key.
Are there any api endpoints of jungle bloks to get the accountname from public key?