wallet-provider

a offcial wallet provider for DexMask wallet

Useage

  • install connector package

  yarn add dex-wallet-connector
  • use connector in component

import React, { useCallback } from 'react';
import { useWeb3React } from '@web3-react/core';
import DexWalletConnector from 'dex-wallet-connector';

const dexWalletConnector = new DexWalletConnector({
  supportedChainIds: [
    '0x1'
  ]
});

function ConnectWalletComponent() {
  const { activate, deactivate } = useWeb3React();

  const connect = useCallback(() => {
    activate(dexWalletConnector, (erorr) => {
      //  do sth else
    });
  }, [activate]);

  const disConnect = useCallback(() => {
    deactivate();
    //  do sth else
  }, [deactivate]);

  return (
    <>
      {/*  component layout */}
    </>
  )
}

GitHub

View Github