Supported Connectors

This section provides guidance on integrating different library connectors to facilitate wallet connectivity in your application. We support connectors for web3react/v6arrow-up-right, wagmiarrow-up-right, and react hooksarrow-up-right. Each connector has its own set of configurations/features and is designed to simplify the process of connecting to the Stargazer Wallet.

web3react/v6arrow-up-right is a framework that allows you to interact with Ethereum blockchain and smart contracts. It provides a simple and flexible way to connect to different wallets.

Installationarrow-up-right

To install the web3react/v6arrow-up-right connector, run the following command:

If you're using NPM

npm install @stardust-collective/web3-react-stargazer-connector

If you're using NPM

yarn add @stardust-collective/web3-react-stargazer-connector

Example Usagearrow-up-right

import { StargazerWeb3ReactConnector } from "@stardust-collective/web3-react-stargazer-connector";
import { useWeb3React } from "@web3-react/core";

const stargazerConnector = new StargazerWeb3ReactConnector({
  supportedChainIds: [1, 3],
});

function App() {
  const { activate, active } = useWeb3React();

  const connect = async () => {
    try {
      await activate(stargazerConnector);
    } catch (ex) {
      console.error(ex);
    }
  };

  return (
    <div>
      <button onClick={connect}>{active ? "Connected" : "Connect"}</button>
    </div>
  );
}

export default App;

wagmiarrow-up-right is a set of React Hooks for Ethereum, which simplifies the process of connecting to Ethereum networks and smart contracts.

Installationarrow-up-right

To install the wagmiarrow-up-right connector, run the following command:

If you're using NPM

If you're using NPM

Example Usagearrow-up-right

The react hooksarrow-up-right connector is a generic react hook that will enable your app to connect to the stargazer wallet on the constellation network, it will return a EIP-1193 compatible provider (among other properties), that will only connect to the constellation network (DAG) via RPC requests, the constellation RPC API reference can be found herearrow-up-right.

Installationarrow-up-right

To install the react hooksarrow-up-right connector, run the following command:

If you're using NPM

If you're using NPM

Example Usagearrow-up-right

New Connectors Supportarrow-up-right

We are committed to expanding our support for library connectors to meet the evolving needs of our users. If you require a connector that is not currently supported, or have suggestions for new connectors, we are open to exploring these possibilities and integrating them into the wallet.

Requesting New Connectorsarrow-up-right

To request the addition of new library connectors or suggest improvements, please reach out to us through the following channels:

Last updated

Was this helpful?