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

@deficonnect/connector-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deficonnect/connector-client

connector-client for connect to wallet via websocket

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

@deficonnect/connector-client

deficonnect core package, support websocket message encrypt/decode and send/receive.

Installation

use npm package manager

npm install "@deficonnect/connector-client"

Used as model

if you use web3-react, it is easy to integrate: DeFiWeb3Connector has implement AbstractConnector from web3-react

import { DeFiWeb3Connector } from 'deficonnect'

const connector = new DeFiWeb3Connector({
  supportedChainIds: [1],
  rpc: { 1: 'https://mainnet.infura.io/v3/INFURA_API_KEY' },
  pollingInterval: 15000
})
connector.activate()

Used as script tag

<script type="module" src="https://unpkg.com/deficonnect/dist/index.umd.js"></script>

<script>
const connector = new window.DeFiConnect.DeFiWeb3Connector({
  supportedChainIds: [1],
  rpc: { 1: 'https://mainnet.infura.io/v3/INFURA_API_KEY' },
  pollingInterval: 15000
})
</script>
API
ParametersDescriptionTypeExmapleDefault
supportedChainIdsnumber[][1, 2]-
rpcObject{1: 'https://rpc', 2: 'https://rpc2'}-
pollingIntervalnumber15000-
Functions
ParametersDescriptionTypeExmapleDefault
activate() => Promise<void>await connector.activate()-
deactivate() => Promise<void>await connector.deactivate()-

FAQs

Package last updated on 05 Jul 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