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

upgrade @onsol/tldparser to latest #3379

Closed
wants to merge 0 commits into from

Conversation

crypt0miester
Copy link
Contributor

We upgraded the @onsol/tldparser to the latest version which now returns the owner of the nft if the domain is wrapped as an nft.

Another small update from ANS protocol, we built a bridge to bring (ENS) .eth domains to Solana through Wormhole x ANS protocol.

those are NFTs from the get go. that means people could send stuff to .eth on solana 😆.

@vercel
Copy link

vercel bot commented Mar 16, 2023

@crypt0miester is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@peterpme
Copy link
Contributor

peterpme commented Mar 16, 2023

hi there @crypt0miester, thank you for this!

I temporarily removed tldparser (#3365) bc it doesn't work on mobile via expo

we can move this discussion over to your repo. in the mean time, here's what we need:

  1. getHashedName should be an async function.

this change should have no impact on consumers of the library. in the 2 places that its called, there are already async functions included

wrapping it in node's utils.promisify should work great!

  1. include a separate index.native.js (a diff example linked so you can see how) file that can polyfill crypto.createHash using expo-crypto. expo-crypto will work with both react-native and crypto

a separate index.native.js file will be consumed by expo/react-native automatically without having an impact on your web users

the following code should be functionally equivalent:

const encryptedActionSecret1 = crypto
      .createHash("sha256")
      .update(bytes, "utf-8")
      .digest("utf-8") as bytes;

    const encryptedActionSecret2 = (await Crypto.digestStringAsync(
      Crypto.CryptoDigestAlgorithm.SHA256,
      Buffer.from(bytes, "utf-8").toString()
    )) as bytes;

if you have any questions please lmk. thank you!

@crypt0miester
Copy link
Contributor Author

hi there @crypt0miester, thank you for this!

I temporarily removed tldparser (#3365) bc it doesn't work on mobile via expo

we can move this discussion over to your repo. in the mean time, here's what we need:

  1. getHashedName should be an async function.

this change should have no impact on consumers of the library. in the 2 places that its called, there are already async functions included

wrapping it in node's utils.promisify should work great!

  1. include a separate index.native.js (a diff example linked so you can see how) file that can polyfill crypto.createHash using expo-crypto. expo-crypto will work with both react-native and crypto

a separate index.native.js file will be consumed by expo/react-native automatically without having an impact on your web users

the following code should be functionally equivalent:

const encryptedActionSecret1 = crypto
      .createHash("sha256")
      .update(bytes, "utf-8")
      .digest("utf-8") as bytes;

    const encryptedActionSecret2 = (await Crypto.digestStringAsync(
      Crypto.CryptoDigestAlgorithm.SHA256,
      Buffer.from(bytes, "utf-8").toString()
    )) as bytes;

if you have any questions please lmk. thank you!

awesome. thanks for the quick reply. I'm on it.

@crypt0miester
Copy link
Contributor Author

hello @peterpme,

I updated getHashedName and asyncified it and awaited everywhere.

used what bonfida did by using @ethersproject/sha2 because it is easier since ethersproject already includes the shims.

is this what you're looking for?

please update me. because I will need to push to npmjs if it is.

thank you btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants