Skip to main content

Getting started

The Catalog exposes a package facilitating the interaction with Web3 providers like Metamask. You can see more about in the documentation

Providers supported

  • Metamask
  • WalletConnect
  • Coinbase Wallet

Pre-requisites

The Nevermined providers is a package built with React and Typescript. It requires Node JS v14 or higher. You can find online instructions about How to install Node JS.

How to install ?

yarn add @nevermined-io/catalog-providers
or
npm install --save @nevermined-io/catalog-providers

How to integrate ?

import { WalletProvider, getClient, useWallet } from "@nevermined-io/catalog-providers";
import App from "app";

ReactDOM.render(
<div>
<WalletProvider
client={getClient()}
correctNetworkId={80001}
connectKitProps={
{
theme: 'auto',
mode: 'dark',
}
}
>
<App />
</WalletProvider>
</div>,
document.getElementById("root") as HTMLElement
);

How to use ?

const ConnectToMetaMask = () => {
const { login, walletAddress, getConnectors } = useWallet();

return (
<>
<div> {walletAddress}</div>
{!walletAddress && (
<button onClick={() => login(getConnectors()[0])}>Connect To MM</button>
)}
</>
);
};

You can find here a example