Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@avalabs/avalanche-connector

Package Overview
Dependencies
Maintainers
14
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@avalabs/avalanche-connector

This is a connector for the upcoming release of `@web3-react/core`. This serves as an example of how to connect for versions older than `8.0.17-beta.0`. If you need help connecting to older versions feel free to reach out at `coreintegrations@avalabs.org`

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
14
Created
Source

Avalanche Connector

This is a connector for the upcoming release of @web3-react/core. This serves as an example of how to connect for versions older than 8.0.17-beta.0. If you need help connecting to older versions feel free to reach out at coreintegrations@avalabs.org

Getting started

There is a working example in this repo under the package avalanche connector example

import { createContext, useContext } from 'react';
import { initializeConnector, Web3ReactHooks } from '@web3-react/core';
import { Avalanche } from '@avalabs/avalanche-connector';

const Web3ConnectionContext = createContext<
  {
    connector: Avalanche;
  } & Web3ReactHooks
>({} as any);

export function Web3ConnectionContextProvider({ children }: { children: any }) {
  const [connector, hooks] = initializeConnector(
    (actions) => new Avalanche(actions, true)
  );

  return (
    <Web3ConnectionContext.Provider
      value={{
        connector,
        ...hooks,
      }}
    >
      {children}
    </Web3ConnectionContext.Provider>
  );
}

export function useWeb3ConnectionContext() {
  return useContext(Web3ConnectionContext);
}
<Web3ConnectionContextProvider>
  <App />
</Web3ConnectionContextProvider>
import { useWeb3ConnectionContext } from 'your-path-here';

export function YourFancyComponent() {
  const { provider, hooks } = useWeb3ConnectionContext();
}

FAQs

Package last updated on 16 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc