Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@blocto/dappauth

blocto1kMIT2.2.2

A util to prove actionable control ('ownership') over a public Ethereum address using eth_sign

ethereum, ownership, control, eth_sign

readme

dappauth.js

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';
    const signature =
      '0x49b5e108d0b7ce795125acbc08b331aad170e4afe8daa5b4b484d12b9253316c4ca0cb36cec51682bcc9a65d6cb28002bd4835845d8f1de21afafe1132eaed3d1b28171e3bf436f2301c0bd657501cafb2a9344efe042495adba2852858db559da2fb4280007de4d631b9357493a979c4024927aec580ef3a22603918eb3b3071b1c';
    const address = '0x86aa354fc865925f945b803ceae0b3f9d856b269';

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

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

changelog

@blocto/dappauth

2.2.2

Patch Changes

  • 48fa07a: fix: handle existedSDK handle window not defined

2.2.2-beta.0

Patch Changes

  • 48fa07a: fix: handle existedSDK handle window not defined

2.2.1

Patch Changes

  • 9609a4e: fix: build config and test Switched from Mocha to Jest

2.2.1-beta.0

Patch Changes

  • 9609a4e: fix: build config and test Switched from Mocha to Jest

2.2.0

Minor Changes

  • 5ae0ff0: restructure @blocto/dappauth and using rollup bundle