Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: getOwner to getAddress #384

Merged

Conversation

heronlancellot
Copy link
Member

@heronlancellot heronlancellot commented Jun 4, 2024

Closes #320

  • With getAddress we can retrieve the actual address searched ( per example: 0xneves )
image

GetAddress & GetOwner differences:

/**
 * Returns the owner by the given name and current configured or detected Registry
 * @param name - The ENS name
 * @returns - Returns the address of the owner of the name.
 * @example
 * ```ts
 * const owner = await web3.eth.ens.getOwner('ethereum.eth');
 * ```
 */
public async getOwner(name: string): Promise<unknown> {
	return this._registry.getOwner(name);
}

/**
 * Resolves an ENS name to an Ethereum address.
 * @param ENSName - The ENS name to resolve
 * @param coinType - (Optional) The coin type, defaults to 60 (ETH)
 * @returns - The Ethereum address of the given name
 * ```ts
 * const address = await web3.eth.ens.getAddress('ethereum.eth');
 * console.log(address);
 * > '0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359'
 * ```
 */
public async getAddress(ENSName: string, coinType = 60) {
	return this._resolver.getAddress(ENSName, coinType);
}

Copy link

vercel bot commented Jun 4, 2024

@heronlancellot is attempting to deploy a commit to the Shared Blockful's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@0xneves 0xneves left a comment

Choose a reason for hiding this comment

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

Nice!

@heronlancellot heronlancellot marked this pull request as ready for review June 5, 2024 13:24
@heronlancellot heronlancellot merged commit 7b906ec into blockful-io:develop Jun 5, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants