2.0.33 • Published 1 year ago

@qomet/skeptic-connect v2.0.33

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.

Network Support

The following networks are supported:

  • Goerli (Ethereum)
  • Sepolia (Ethereum)
  • Mainnet (Etheruem)
  • Mumbai (Polygon)
  • Mainnet (Polygon)

Quick Guide

Use SkepticProvider as one of the top parent providers, as shown below:

...
import { SkepticProvider } from "@qomet/skeptic-connect";
...

function App() {
  return (
    <SkepticProvider
      infuraId='4784dc24...a4bf480922a'
      servicesBaseURL='https://skeptic-dev.arteq.io/skeptic/v1'
      startingNetwork='ethereum'
      startingNetwork='goerli'
      allowNetworkChange={false}
      signMessage='Enter your sign message here!'
    >
      ...
    </SkepticProvider>
  );
}

export default App;

NOTE: Usage of the window.SKEPITC_CONNET_* variables are deprecated and they won't be picked up by the SDK. You can still keep them in the project but you have to use SkepticProvider's props to pass them on.

NOTE: If you want to disable reCAPTCHA (mainly for local testing), use the following window variable:

window.DISABLE_RECAPTCHA

NOTE: In order to use reCAPTCHA, add recaptcha lib to your index.html and set the sitekey like below:

window.rcSiteKey = "6LfJSDceAAAAAPLNlczwZMQbOXbATkOZiW0u0GA3";

Use useSkeptic hook to access the Skeptic context.

import { useSkeptic } from "@qomet/skeptic-connect";

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>
  );
}

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
2.0.33

1 year ago

2.0.31

1 year ago

2.0.32

1 year ago

2.0.28

2 years ago

2.0.29

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.30

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.10

2 years ago

2.0.19

2 years ago

2.0.17

2 years ago

2.0.18

2 years ago

2.0.26

2 years ago

2.0.27

2 years ago

2.0.24

2 years ago

2.0.25

2 years ago

2.0.22

2 years ago

2.0.23

2 years ago

2.0.20

2 years ago

2.0.21

2 years ago

1.2.0

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.20.3

3 years ago