This package has been deprecated

Author message:

This package is no longer maintained, instead look into @arbitrum/sdk

arb-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i arb-ts

Weekly Downloads

245

Version

1.0.2

License

Apache-2.0

Unpacked Size

5.88 MB

Total Files

482

Last publish

Collaborators

  • spsjvc
  • gzeon
  • dzgoldman
  • hkalodner