0.20.3 • Published 1 year ago

@arteq-tech/skeptic-connect v0.20.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Skeptic Connect

A repo to hold all reusable common react components related to Skeptic project.

Connecting wallet and authenticating

Important

Always set these:

window.SKEPTIC_CONNECT_CHAIN = "ethereum";
window.SKEPTIC_CONNECT_NETWORK = "goerli";
window.SKEPTIC_CONNECT_SERVICES_BASE_URL="https://skeptic-dev.arteq.tech/skeptic/v1";
ReactDOM.render(
    <React.StrictMode>
      <App />
    </React.StrictMode>,
    document.getElementById('root')
);

If you want to disable reCaptcha (local testing) Add also this global variable:

window.DISABLE_RECAPTCHA

Or add recaptcha lib in your index.html and set sitekey like so:

window.rcSiteKey = "6LfJSDceAAAAAPLNlczwZMQbOXbATkOZiW0u0GA3";
  • To customize sign message, please set SKEPTIC_CONNECT_SIGN_MESSAGE environment variable before building your repo

To set the sign message, set this global variable:

window.SKEPTIC_CONNECT_SIGN_MESSAGE = "Welcome to skeptic! signing this message means you agree with our terms of use (https://example.org/terms-of-use), please sign this message in order to log in"
import { useSkeptic } from "@arteq-tech/skeptic-connect";

window.SKEPTIC_CONNECT_CHAIN = "ethereum";
window.SKEPTIC_CONNECT_NETWORK = "goerli";
window.SKEPTIC_CONNECT_SERVICES_BASE_URL="https://skeptic-dev.arteq.tech/skeptic/v1";

const WalletConnect = () => {

  const {
    logout,
    account,
    initMetamask,
    isWalletConnected,
    initWalletConnect,
  } = useSkeptic();

  return (
    <main>
      {isWalletConnected
        ?  (
          <>
            <h1>Login with wallet</h1>
            <ul>
              <li onClick={initMetamask}>with Metamask</li>
              <li onClick={initWalletConnect}>with WalletConnect</li>
            </ul>
          </>
        ) : (
          <>
            <h2>Wallet Address: {account}</h2>
            <button onClick={logout}>Logout</button>
          </>
        )
      }
    </main>
  );
}

const App = () => (
  <WalletProvider>
    <WalletConnect />
  </WaletProvider>
);

Possible issues:

  • You're not using React@17 This package is created based on react 17 and haven't been tested on react 18 which was just released if you've installed react with create-react-app, you can downgrade react to 17 like so:
  • edit package.json and change react from 18 (or any other versions) to 17 in dependecies section
  • rm -rf ./node_modules
  • do a yarn or npm install again
  • change index.jsx to use previous react-dom import and syntax
  • You're using react-scripts>4.0 This version has some issues with source map (because of webpack 5)

It should be fine as long as you disable source-map in .env file:

  • add a line to .env file: GENERATE_SOURCEMAP=false

TODO:

The following functionalities must be covered:

  • login DONE
  • logout DONE
  • profile DONE
  • updateProfile DONE
  • sendEmailOTP DONE
  • verifyEmailOTP DONE
  • balance of contracts (nft, ethereum, erc20 token, polygon, etc)
0.20.1

2 years ago

0.20.0

2 years ago

0.20.3

1 year ago

0.20.2

2 years ago

0.19.0

2 years ago

0.15.4

2 years ago

0.14.0

2 years ago

0.15.0

2 years ago

0.16.0

2 years ago

0.15.1

2 years ago

0.17.0

2 years ago

0.16.1

2 years ago

0.15.2

2 years ago

0.18.0

2 years ago

0.16.2

2 years ago

0.15.3

2 years ago

0.13.0

2 years ago

0.12.0

2 years ago

0.11.32

2 years ago

0.11.31

2 years ago

0.11.30

2 years ago

0.11.29

2 years ago

0.11.28

2 years ago

0.11.27

2 years ago

0.11.26

2 years ago

0.11.25

2 years ago

0.11.24

2 years ago

0.11.23

2 years ago

0.11.22

2 years ago

0.11.21

2 years ago

0.11.20

2 years ago

0.11.19

2 years ago

0.11.18

2 years ago

0.11.17

2 years ago

0.11.16

2 years ago

0.11.15

2 years ago

0.11.14

2 years ago

0.11.12

2 years ago

0.11.11

2 years ago

0.11.10

2 years ago

0.11.9

2 years ago

0.11.8

2 years ago

0.11.7

2 years ago

0.11.6

2 years ago

0.11.5

2 years ago

0.11.4

2 years ago

0.11.3

2 years ago

0.11.2

2 years ago

0.11.1

2 years ago