Primary Address from FID
Get the primary verified address associated with a Farcaster FID.
function getPrimaryAddressByFid(uint256 _fid) external view returns (address primaryAddress);YourContract.sol
1// Import the Faracle interface
2import "./IFaracle.sol";
3
4contract GetPrimaryAddress {
5
6 IFaracle public faracle = IFaracle(0x687d65ce04abbca3dac57cda6c358e497bfd320e);
7
8 constructor() {}
9
10 function getPrimaryAddress(uint256 _fid) public view returns (address _primaryAddress) {
11
12 // Get the primary verified address associated with the FID
13 _primaryAddress = faracle.getPrimaryAddressByFid(_fid);
14 }
15
16}