Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Add ENS name and image view to conversations #24

Merged
merged 3 commits into from
Jan 17, 2023
Merged

Conversation

elisealix22
Copy link
Contributor

This PR adds the ability to query Infura for ENS information and display it for each conversation in the list. I added a README with steps to configure Infura instead of committing an Infura url directly. Also in order to accomplish this, it adds three new libraries:

  1. web3.swift to be able to resolve an ENS name from an address. This is already used by our SDK and I think we'll actually be able to remove it once ENSKit adds name resolution to their library. I opened up a feature request in ENSKit here.
  2. ENSKit to be able to resolve ENS data from an ENS name. We use this to grab the avatar currently.
  3. IGIdenticon to be able to show a stable, unique image for each peer address that doesn't have an ENS avatar.

Relates to #18

Light mode Dark mode
Simulator Screen Shot - iPhone 14 - 2023-01-16 at 16 57 53 Simulator Screen Shot - iPhone 14 - 2023-01-16 at 16 58 00

Copy link

@nplasterer nplasterer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and is going to be a huge value win! I'm not sure how this all works so please disregard the comments if I'm missing something. 🙏

self.ensName = value
}
case let .couldNotBeResolved(error):
print("Could not resolve ENS name: \(error)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe if it can't be resolved we just fall back to the wallet address?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I fallback in the body method right now

case let .resolved(value):
await loadEnsImage(ensName: value)
case let .couldNotBeResolved(error):
print("Could not resolve ENS name: \(error)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the name can we roll back to a default image?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elisealix22 elisealix22 merged commit 83e5fd6 into main Jan 17, 2023
@elisealix22 elisealix22 deleted the ea/ens-data branch January 17, 2023 19:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants