Socket
Book a DemoInstallSign in
Socket

@huskyfinance/l2-letsgo

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huskyfinance/l2-letsgo

lets go L2

latest
npmnpm
Version
1.0.5
Version published
Maintainers
2
Created
Source

LetsGo

The purpose of this package it to help Dapp developers handle L1 to L2 transition.

Installation

npm i @huskyfinance/l2-letsgo

Usage

import LetsGo, { xDai } from '@huskyfinance/l2-letsgo'

const letsgo = new LetsGo({targetNetwork: xDai})

// popup metamask switch network notification
await letsgo.setupNetwork()

React

Simple Example:

import LetsGo, { xDai } from 'l2-letsgo'

function App() {

  const [isReady, setIsReady] = useState(false)

  const userAddress = '0x000abcd'

  useEffect(() => {
    const letsgo = new LetsGo({ 
      targetNetwork: xDai,
      // optional
      address: userAddress,
      checkBalance: true
    })
    letsgo.setupNetwork().then(() => {
      setIsReady(true)
    })
  }, [userAddress])
}

Config

You can also pass in custom network config!


const ArbitrumTestnet = {
  name: 'Arbitrum (Kovan)',
  rpcUrls: ['https://kovan4.arbitrum.io/rpc'],
  blockExplorerUrl: 'https://explorer.arbitrum.io/#/',
  chainId: 212984383488152,
}

const letsgo = new LetsGo({targetNetwork: ArbitrumTestnet})

await letsgo.setupNetwork()

FAQs

Package last updated on 18 Apr 2021

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