Get profiles by username

Fetch Public Profiles of ANY HandCash user

Public HandCash user-data can be accessed using the account.profile.getPublicProfilesByHandle function.

const {HandCashConnect} = require('@handcash/handcash-connect');
const handCashConnect = new HandCashConnect({ 
   appId: '<app-id>', 
   appSecret: '<secret>',
}); 

const account = handCashConnect.getAccountFromAuthToken(token);

const users = ['cryptokang', 'eyeone']
const userProfiles = await account.profile.getPublicProfilesByHandle(users);
console.log(userProfiles);
[
  {
      id: "5f15c31c3c177d003028eb97",
      handle: "cryptokang",
      paymail: "[email protected]",
      bitcoinUnit: "DUR",
      displayName: "Brandon",
      avatarUrl: "https://handcash.io/avatar/7d399a0c-22cf-40cf-b162-f5511a4645db",
      localCurrencyCode: "USD",
   },
  {
      id: "5f14c41c3c188d003027eb77",
      handle: "eyeone",
      paymail: "[email protected]",
      bitcoinUnit: "SAT",
      displayName: "Ivan",
      avatarUrl: "https://handcash.io/avatar/7d399a0c-22cf-40cf-b162-f5511a4645db",
      localCurrencyCode: "USD",
   },
]

This is very useful to verify if a handle collected from any user input is valid.