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

feat: update dappauth lib for compatibility #1781

Merged
merged 3 commits into from
Jul 11, 2023

Conversation

scottphc
Copy link
Contributor

@scottphc scottphc commented Jun 19, 2023

Description

Update dappauth for compatibility.

Don't need to bump version because it only affects the demo.

PLEASE NOTE- Checklist must be complete prior to review.

Checklist

  • Increment the version field in package.json of the package you have made changes in following semantic versioning and using alpha release tagging
  • Check the box that allows repo maintainers to update this PR
  • Test locally to make sure this feature/fix works
  • Run yarn check-all to confirm there are not any associated errors
  • Confirm this PR passes Circle CI checks
  • Add or update relevant information in the documentation

Docs Checklist

  • Include a screenshot of any changes (see docs README on running locally)
  • Add/update the appropriate package README (if applicable)
  • Add/update the related module in the docs demo (if applicable)
  • Add/update the related package in the docs/package.json file (if applicable)

@vercel
Copy link

vercel bot commented Jun 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web3-onboard-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2023 4:54am

@socket-security
Copy link

socket-security bot commented Jun 19, 2023

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@blocto/dappauth 2.1.0 None +0 20.1 kB scottphc

🚮 Removed packages: @dapperlabs/dappauth@2.0.5

@leightkt
Copy link
Contributor

@scottphc this is looking good! Is there any documentation for the @blocto/dappauth package?

@scottphc
Copy link
Contributor Author

scottphc commented Jun 28, 2023

@scottphc this is looking good! Is there any documentation for the @blocto/dappauth package?

Currently no. I can add some here:

dappauth.js is a tool that can verify EOA signature and smart contract signature (ERC1271).

Usage:

const Web3 = require('web3');
  const DappAuth = require('@blocto/dappauth');

  const dappAuth = new DappAuth(new Web3.providers.HttpProvider('http://localhost:8545'));

  async function debug() {
    const challenge = 'foo';
    // can be EOA signature or smart contract signature (ERC1271)
    const signature =
    '0x49b5e108d0b7ce795125acbc08b331aad170e4afe8daa5b4b484d12b9253316c4ca0cb36cec51682bcc9a65d6cb28002bd4835845d8f1de21afafe1132eaed3d1b28171e3bf436f2301c0bd657501cafb2a9344efe042495adba2852858db559da2fb4280007de4d631b9357493a979c4024927aec580ef3a22603918eb3b3071b1c';
    const address = '0x86aa354fc865925f945b803ceae0b3f9d856b269';

    try {
      const isAuthorizedSigner = await dappAuth.isAuthorizedSigner(
        challenge,
        signature,
        address,
      );

      console.log(isAuthorizedSigner); // true
    } catch (e) {
      console.log(e);
    }
  }

@Adamj1232 Adamj1232 merged commit 667b753 into blocknative:develop Jul 11, 2023
2 checks passed
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.

3 participants