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

arb-ts

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arb-ts

Typescript library client-side interactions with Arbitrum

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Arb-TS

Typescript library for doing Arbitrum stuff, particular stuff like interacting between L1 and L2. Uses ethers.

Quickstart

const ethProvider = new providers.JsonRpcProvider(ethRPC)
const arbProvider = new providers.JsonRpcProvider(arbRPC)

const connectedL1Wallet = new Wallet(myPrivateKey, ethProvider)
const connectedL2Wallet = new Wallet(myPrivateKey, arbProvider)

const bridge = await Bridge.init(
  connectedL1Wallet,
  connectedL2Wallet
  l1GatewayRouter,
  l2GatewayRouter
)

bridge.depositEth(parseEther('32'))

See integration tests for sample usage.

Run Integration tests

yarn test:integration

Defaults to rinkArby, for custom network use --network flag.

rinkArby expects env var DEVNET_PRIVKEY to be prefunded with at least 0.02 ETH, and env var INFURA_KEY to be set. (see integration_test/config.ts)

Bridge A Standard Token

Bridging new a token to L2 (i.e., deploying a new token contract) through the standard gateway is done by simply depositing a token that hasn't yet been bridged. This repo includes a script to trigger this initial deposit/deployment:

  1. clone arbitrum monorepo

  2. git submodule update --init --recursive

  3. yarn install (from root)

  4. cd packages/arb-ts

  5. Set PRIVKEY environmental variable (you can use .env) to the key of the account from which you'll be deploying (account should have some balance of the token you're bridging).

  6. Set MAINNET_RPC environmental variable to L1 RPC endpoint (i.e., https://mainnet.infura.io/v3/my-infura-key)

  7. yarn bridgeStandardToken

Required CL params: networkID:number — Chain ID of L1 network l1TokenAddress:string — address of L1 token to be bridged

Ex: yarn bridgeStandardToken --networkID 4 --l1TokenAddress 0xdf032bc4b9dc2782bb09352007d4c57b75160b15 --amount 3

FAQs

Package last updated on 10 Nov 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

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