Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

@huskyfinance/eth-sorbet

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huskyfinance/eth-sorbet

React comment to help transition between L1 and L2s

latest
Source
npmnpm
Version
0.1.15
Version published
Maintainers
2
Created
Source

eth-sorbet

Codacy Badge NPM

Smooth transition to L2, just like sorbet before main course


Winners of Arbitrum 🏆 and Optimism 🏆 for ETHGlobal Scaling Ethereum 2021 Hackathon

Live Demo

eth-sorbet is a react component that improves DApp users' onboarding experience to L2 networks or sidechains.

When a user lands on the DApp, it will bring up a series of screens that guides the users to switch to the L2 network that the developer selected. Users will no longer need to manually enter the L2 network configs in their wallets and can make deposits and interact with the L2 networks right away.

Alt Welcome screen in eth-sorbet eth-sorbet saves you from managing user onboarding!

Alt Switching networks in eth-sorbet We handle wallet RPC calls to add network for users, instead of asking your users to do that manually.

Install

npm install --save @huskyfinance/eth-sorbet

Usage

See example for more detailed usage guide.

import React, { Component } from 'react'

// import modal and target network config
import { Sorbet, xDai } from '@huskyfinance/eth-sorbet'

// load css
import '@huskyfinance/eth-sorbet/dist/index.css'

const provider = window.ethereum

const config = {
  targetNetwork: xDai,
  dappName: 'Example App',

  open: isOpen,
  handleClose: handleClose,

  // optional

  // the user address to check their balance.
  address: userAddress,

  // logo of your app
  dappLogo: 'https://www.kkbox.com/about/img/app_icons/kkbox_app_icon.png',

  // theme color
  color: '#26EFE6'

  // darkmode
  darkMode: true
}

class Example extends Component {
  render() {
    return <Sorbet config={config} walletProvider={provider} />
  }
}

Supported Networks

Arbitrum logo Avalanche logo Binance Smart Chain logo Optimism logo Polygon / Matic logo POA (Sokol) logo xDai logo

NetworkConfigNative Deposit Supported
Arbitrum (Kovan)
Avalanche-
Binance Smart Chain-
Optimism (Kovan)
Optimism (Mainnet)
Polygon / Matic (Mainnet)
Polygon / Matic (Mumbai)
POA (Sokol)-
xDai

Supported Wallets

Metamask logo
NetworkAdd NetworkSwitch Network
MetaMask

Run in dev

Run the library:

cd \eth-sorbet
yarn start

In another terminal, run the example App which will refresh if the library changes

cd \eth-sorbet\example
yarn start

License

MIT © 2021 husky-finance

Keywords

Ethereum

FAQs

Package last updated on 26 May 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