
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
@arbitrum/sdk
Advanced tools
Typescript library for client-side interactions with Arbitrum. Arbitrum SDK provides common helper functionaliy as well access to the underlying smart contract interfaces.
Below is an overview of the Arbitrum SDK functionality. See the tutorials for further examples of how to use these classes.
import { getL2Network, EthBridger } from '@arbitrum/sdk'
const l2Network = await getL2Network(
l2ChainID /** <-- chain id of target Arbitrum chain */
)
const ethBridger = new EthBridger(l2Network)
const ethDepositTxResponse = await ethBridger.deposit({
amount: utils.parseEther('23'),
l1Signer: l1Signer /** <-- connected ethers-js Wallet */,
l2Provider: l2Provider /** <--- ethers-js Provider */,
})
const ethDepositTxReceipt = await ethDepositTxResponse.wait()
/** check ethDepositTxReceipt.status */
import { L1TransactionReceipt, L1ToL2MessageStatus } from '@arbitrum/sdk'
const l1TxnReceipt = new L1TransactionReceipt(
txnReceipt /** <-- ethers-js TransactionReceipt of an ethereum tx that triggered an L1 to L2 message (say depositting a token via a bridge) */
)
const l1ToL2Message = await l1TxnReceipt.getL1ToL2Message(
l2Signer /** <-- connected ethers-js Wallet */
)
const res = await l1ToL2Message.waitForStatus()
if (res.status === L1ToL2MessageStatus.FUNDS_DEPOSITED_ON_L2) {
/** Message wasn't auto-redeemed; redeem it now: */
const response = await l1ToL2Message.redeem()
const receipt = await response.wait()
} else if (res.status === L1ToL2MessageStatus.REDEEMED) {
/** Message succesfully redeeemed */
}
import { L2TransactionReceipt } from '@arbitrum/sdk'
const l2TxnReceipt = new L2TransactionReceipt(
txnReceipt /** <-- ethers-js TransactionReceipt of an arbitrum tx */
)
s
/** Wait 3 minutes: */
setTimeout(() => {
const dataIsOnL1 = l2TxnReceipt.isDataAvailable(l2Provider, l1Provider)
// if dataIsOnL1, sequencer has posted it and it inherits full rollup/L1 security
}, 1000 * 60 * 3000)
Arbitrum SDK can be used to bridge assets to/from the rollup chain.The following asset bridgers are currently available:
All asset bridgers have the following methods:
When assets are moved by the L1 and L2 cross chain messages are sent. The lifecycles of these messages are encapsulated in the classes L1ToL2Message and L2ToL1Message. These objects are commonly created from the receipts of transactions that send cross chain messages. A cross chain message will eventually result in a transaction being executed on the destination chain, and these message classes provide the ability to wait for that finalizing transaction to occur.
Arbitrum SDK comes pre-configured for the Mainnet and Rinkeby, and their Arbitrum counterparts. However the networks functionlity can be used register networks for custom Arbitrum instances. Most of the classes in Arbitrum SDK depend on network objects so this must be configured before using other Arbitrum SDK functionlity.
As part of normal operation the Arbitrum sequencer will messages into the rollup chain. However, if the sequencer is unavailable and not posting batches, the inbox tools can be used to force the inclusion of transactions into the rollup chain.
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)
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:
clone arbitrum-sdk
yarn install (from root)
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).
Set MAINNET_RPC environmental variable to L1 RPC endpoint (i.e., https://mainnet.infura.io/v3/my-infura-key)
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
Typescript library client-side interactions with Arbitrum
The npm package @arbitrum/sdk receives a total of 64,160 weekly downloads. As such, @arbitrum/sdk popularity was classified as popular.
We found that @arbitrum/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.