getPortrait()

  /**
   * Get a User Portrait
   * @param {UserPortraitAddress | UserPortraitENSName} identity - The identity of the user that the user would like to get a Portrait for.
   * @returns {Promise<PortraitObject>} - The Portrait object, which contains the User Portrait data.
   * @beta
   * @async
   * @throws {Error} - Will throw an error if the identity is not a valid address or ENS name.
   * @throws {Error} - Will throw an error if the user does not have a Portrait.
   * @throws {Error} - Will throw an error if the user's Portrait is not a valid JSON object.
   */
  getPortrait(
    userAddress: Exclude<Identity, CollectivePortraitName>,
  ): Promise<JSON> {
    const hash = this.getPortraitHash(userAddress);
    return fetchPortrait(
      this.portrait.ipfsGateways,
      this.portrait.arweaveGateway,
      hash,
      this.portrait.arweaveGraphQLprovider,
      userAddress,
    );
  }

Last updated