Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: 'gitsubmodule' # See documentation for possible values
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'daily'
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ yarn-error.log*

/i18n/*/docusaurus-plugin-content-docs/current/*

sdk-sidebar.js

## Claude
.agent/
.audit/
.cursor/
.serena/
.audit/
.claude/plans
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ This repository is organized as follows:
- `node-running/` - Node operation guides
- `partials/` - Reusable content components and troubleshooting guides
- `run-arbitrum-node/` - Node setup and configuration
- `sdk/` - Auto-generated SDK documentation - Do not edit
- `stylus/` - Stylus smart contract development
- `welcome/` - Getting started content

Expand All @@ -39,8 +38,6 @@ This repository is organized as follows:
- **`scripts/`**: Repository maintenance, build scripts, and content generators
- **`static/`**: Static assets (images, files, JSON data)

> **Note:** SDK API docs (`docs/sdk/`) and Stylus examples (`docs/stylus/`) are committed directly to the repository. They are regenerated from upstream repos ([arbitrum-sdk](https://github.com/OffchainLabs/arbitrum-sdk), [stylus-by-example](https://github.com/offchainlabs/stylus-by-example)) via the `update-external-content` GitHub Actions workflow.

## Contribution

For most of the docs content, you can contribute by simply reviewing our [docs contribution guidelines](https://docs.arbitrum.io/for-devs/contribute) and opening a PR!
Expand Down
10 changes: 0 additions & 10 deletions dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
"docsPath": "docs/arbitrum-docs/how-arbitrum-works",
"description": "Core Arbitrum protocol implementation"
},
{
"id": "arbitrum-sdk",
"name": "Arbitrum SDK",
"repo": "https://github.com/OffchainLabs/arbitrum-sdk",
"currentDocsVersion": "v4.0.4",
"latestRelease": "v4.0.4",
"latestReleaseDate": "2025-04-03",
"docsPath": "docs/arbitrum-docs/sdk",
"description": "JavaScript SDK for interacting with Arbitrum chains"
},
{
"id": "stylus-sdk",
"name": "Arbitrum Stylus SDK",
Expand Down
2 changes: 1 addition & 1 deletion docs/build-decentralized-apps/02-how-to-estimate-gas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Multiplying the value from `eth_estimateGas` by the child chain gas price gives

Alternatively, call `NodeInterface.gasEstimateComponents()` and use the first result (`gasEstimate`) as your gas limit. Multiply by the third result (`baseFee`) to get the total cost.

For [retryable tickets](/how-arbitrum-works/deep-dives/l1-to-l2-messaging.mdx) (parent-to-child chain messages), use [`L1ToL2MessageGasEstimator.estimateAll()`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/src/lib/message/L1ToL2MessageGasEstimator.ts#L215) from the Arbitrum SDK or [`NodeInterface.estimateRetryableTicket()`](https://github.com/OffchainLabs/@@nitroRepositorySlug=nitro@@/blob/@@nitroVersionTag=v3.9.8@@/nodeInterface/NodeInterface.go#L120).
Note that when working with parent to child chain messages (also known as [retryable tickets](/how-arbitrum-works/deep-dives/l1-to-l2-messaging.mdx)), you can use the function [`ParentToChildMessageGasEstimator.estimateAll()`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/message/ParentToChildMessageGasEstimator.ts) of the Arbitrum SDK or [`NodeInterface.estimateRetryableTicket()`](https://github.com/OffchainLabs/@@nitroRepositorySlug=nitro@@/blob/@@nitroVersionTag=v3.9.8@@/nodeInterface/NodeInterface.go#L120) to get all the gas information needed to send a successful transaction.

## The fee formula

Expand Down
2 changes: 1 addition & 1 deletion docs/build-decentralized-apps/04-cross-chain-messaging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Creating an arbitrary parent-to-child chain contract call occurs via the Inbox's

- **How-to guide**: [How to bridge from the parent chain to the child chain](/build-decentralized-apps/how-to-bridge-from-parent-chain.mdx)
- **Protocol details**: [Parent to child chain messaging](/how-arbitrum-works/deep-dives/l1-to-l2-messaging.mdx)
- **Example**: [`Greeter` tutorial](https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/greeter) using the [Arbitrum SDK](../../sdk)
- **Example**: [`Greeter` tutorial](https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/greeter) using the [Arbitrum SDK](https://github.com/OffchainLabs/arbitrum-sdk)

## Arbitrum-to-Ethereum messaging

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ In this case, when using this function, a single action occurs:

1. Call the function `setGateway` of `L1GatewayRouter`. This call updates the `l1TokenToGateway` internal mapping and sends a retryable ticket to the counterpart `L2GatewayRouter` contract on the child chain to set its mapping to the new values.

To simplify the process, we’ll use Arbitrum’s SDK and call the method [`registerCustomToken`](../../../sdk/assetBridger/erc20Bridger#registercustomtoken) of the [`AdminErc20Bridger`](../../../sdk/assetBridger/erc20Bridger#adminerc20bridger) class, which will call the `registerTokenOnL2` method of the token passed by parameter.
To simplify the process, we’ll use Arbitrum’s SDK and call the method [`registerCustomToken`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) of the [`AdminErc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) class, which will call the `registerTokenOnL2` method of the token passed by parameter.

```tsx
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ When using this function, you will take two actions:
1. Call the function `registerTokenToL2` of `L1CustomGateway`. This call will change the `l1ToL2Token` internal mapping it holds and send a retryable ticket to the counterpart `L2CustomGateway` contract on the child chain, setting its mapping to the new values as well.
2. Call the function `setGateway` of `L1GatewayRouter`. This call will update the `l1TokenToGateway` internal mapping it holds and send a retryable ticket to the counterpart `L2GatewayRouter` contract on the child chain to set its mapping to the new values.

To simplify the process, we’ll use Arbitrum’s SDK. We’ll call the [`registerCustomToken`](../../../sdk/assetBridger/erc20Bridger#registercustomtoken) method of the [`AdminErc20Bridger`](../../../sdk/assetBridger/erc20Bridger#adminerc20bridger) class, which will call the `registerTokenOnL2` method on the token passed as a parameter.
To simplify the process, we’ll use Arbitrum’s SDK. We’ll call the [`registerCustomToken`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) method of the [`AdminErc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) class, which will call the `registerTokenOnL2` method on the token passed as a parameter.

```typescript
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ To integrate Layer Leap into your custom bridge UI:

2. **Implement the bridging flow**

The simplest implementation uses the Arbitrum SDK:
The simplest implementation uses the [Arbitrum SDK teleporter package](https://www.npmjs.com/package/@arbitrum/sdk/v/3.5.1-teleporter.0) (v3.5.1-teleporter.0):

```typescript
import { TeleportTokenParameters, teleportToken } from '@arbitrum/sdk/dist/lib/teleport/teleport';
Expand Down
18 changes: 9 additions & 9 deletions docs/sdk/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ pnpm install @arbitrum/sdk

Arbitrum SDK can be used to bridge assets to or from an Arbitrum Network. The following asset bridgers are currently available:

- [`EthBridger`](/sdk/assetBridger/ethBridger.md)
- [`Erc20Bridger`](/sdk/assetBridger/erc20Bridger.md)
- [`EthBridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/ethBridger.ts)
- [`Erc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts)

All asset bridgers have the following methods which accept different parameters depending on the asset bridger type:

- [`deposit`](/sdk/assetBridger/assetBridger.md#deposit): moves assets from the Parent to the Child chain
- [`withdraw`](/sdk/assetBridger/assetBridger.md#withdraw): moves assets from the Child to the Parent chain
- [`deposit`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/assetBridger.ts): moves assets from the Parent to the Child chain
- [`withdraw`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/assetBridger.ts): moves assets from the Child to the Parent chain

#### Example `ETH` deposit to Arbitrum One

Expand Down Expand Up @@ -106,7 +106,7 @@ Arbitrum SDK comes pre-configured for Mainnet and Sepolia, and their Arbitrum co

#### Configuring network

To interact with a custom [`ArbitrumNetwork`](/sdk/dataEntities/networks), you can register it using the [`registerCustomArbitrumNetwork`](/sdk/dataEntities/networks.md#registercustomarbitrumnetwork) function.
To interact with a custom [`ArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts), you can register it using the [`registerCustomArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts) function.

```ts
import { registerCustomArbitrumNetwork } from '@arbitrum/sdk';
Expand All @@ -119,7 +119,7 @@ registerCustomArbitrumNetwork({

### Cross chain messages

When assets are moved by the Parent and Child cross chain messages are sent. The lifecycles of these messages are encapsulated in the classes [`ParentToChildMessage`](/sdk/message/ParentToChildMessage) and [`ChildToParentMessage`](/sdk/message/ChildToParentMessage). 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.
When assets are moved by the Parent and Child cross chain messages are sent. The lifecycles of these messages are encapsulated in the classes [`ParentToChildMessage`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/message/ParentToChildMessage.ts) and [`ChildToParentMessage`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/message/ChildToParentMessage.ts). 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.

#### Redeem a parent-to-child message

Expand Down Expand Up @@ -180,9 +180,9 @@ const inboxRec = await resultsParent.wait();

### Utils

- [`EventFetcher`](/sdk/utils/eventFetcher): A utility to provide typing for the fetching of events
- [`MultiCaller`](/sdk/utils/multicall#multicaller): A utility for executing multiple calls as part of a single RPC request. This can be useful for reducing round trips.
- [`constants`](/sdk/dataEntities/constants): A list of useful Arbitrum related constants
- [`EventFetcher`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/utils/eventFetcher.ts): A utility to provide typing for the fetching of events
- [`MultiCaller`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/utils/multicall.ts): A utility for executing multiple calls as part of a single RPC request. This can be useful for reducing round trips.
- [`constants`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/constants.ts): A list of useful Arbitrum related constants

## Development

Expand Down
28 changes: 14 additions & 14 deletions docs/sdk/migrate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ Most instances of "L1" and "L2" have been replaced with "parent" and "child" res
- The `L1Network` is no longer required to be registered before bridging.
- Only Arbitrum networks need to be registered.
- Arbitrum networks are defined as Arbitrum One, Arbitrum testnets, and any Orbit chain.
- If you need a full list of Arbitrum networks, you can use the new [`getArbitrumNetworks`](./dataEntities/networks#getarbitrumnetworks) function.
- To list all of the children of a network, use the new [`getChildrenForNetwork`](./dataEntities/networks#getchildrenfornetwork) function.
- If you need a full list of Arbitrum networks, you can use the new [`getArbitrumNetworks`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts#L322) function.
- To list all of the children of a network, use the new [`getChildrenForNetwork`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts#L300) function.

| v3 Name | v4 Name |
| --------------------- | -------------------------------------------------------------------------------------------------- |
| `L2Network` | [`ArbitrumNetwork`](./dataEntities/networks#arbitrumnetwork) |
| `getL2Network` | [`getArbitrumNetwork`](./dataEntities/networks#getarbitrumnetwork) |
| `l2Networks` | [`getArbitrumNetworks`](./dataEntities/networks#getarbitrumnetworks) |
| `addCustomNetwork` | [`registerCustomArbitrumNetwork`](./dataEntities/networks#registercustomarbitrumnetwork) |
| `L2Network` | [`ArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts#L32) |
| `getL2Network` | [`getArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts#getarbitrumnetwork) |
| `l2Networks` | [`getArbitrumNetworks`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts#L318) |
| `addCustomNetwork` | [`registerCustomArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts#L417) |
| `Network` | *removed* |
| `L1Network` | *removed* |
| `getL1Network` | *removed* |
| `getParentForNetwork` | *removed* |

#### `ArbitrumNetwork` type

`Network` type has been replaced with the [`ArbitrumNetwork`](./dataEntities/networks#arbitrumnetwork) type and some properties have been removed or renamed.
`Network` type has been replaced with the [`ArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts#L32) type and some properties have been removed or renamed.

| v3 Name | v4 Name |
| --------------------- | --------------- |
Expand All @@ -57,7 +57,7 @@ Most instances of "L1" and "L2" have been replaced with "parent" and "child" res

#### `TokenBridge` type

The `TokenBridge` type within the[`ArbitrumNetwork`](./dataEntities/networks#arbitrumnetwork) object has been updated.
The `TokenBridge` type within the [`ArbitrumNetwork`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/dataEntities/networks.ts#L32) object has been updated.

| v3 Name | v4 Name |
| ----------------- | --------------------- |
Expand All @@ -78,19 +78,19 @@ The `TokenBridge` type within the[`ArbitrumNetwork`](./dataEntities/networks#arb

### 3. Updates to `AssetBridger` and `Erc20Bridger` classes

#### [`AssetBridger`](./assetBridger/assetBridger.md) Class Methods
#### [`AssetBridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/assetBridger.ts) Class Methods

The [`AssetBridger`](./assetBridger/assetBridger.md) class methods and properties have been renamed to reflect the new parent-child terminology.
The [`AssetBridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/assetBridger.ts) class methods and properties have been renamed to reflect the new parent-child terminology.

| v3 Name | v4 Name |
| ---------------- | -------------------- |
| `l2Network` | `childNetwork` |
| `checkL1Network` | `checkParentNetwork` |
| `checkL2Network` | `checkChildNetwork` |

#### [`AssetBridger`](./assetBridger/assetBridger.md) Class Method Parameters
#### [`AssetBridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/assetBridger.ts) Class Method Parameters

The objects passed to the class methods of classes that inherit from [`AssetBridger`](./assetBridger/assetBridger.md) ([`EthBridger`](./assetBridger/ethBridger.md) and [`Erc20Bridger`](./assetBridger/erc20Bridger.md)) have been renamed.
The objects passed to the class methods of classes that inherit from [`AssetBridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/assetBridger.ts) ([`EthBridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/ethBridger.ts) and [`Erc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts)) have been renamed.

| v3 Name | v4 Name |
| ---------------- | -------------------- |
Expand All @@ -100,7 +100,7 @@ The objects passed to the class methods of classes that inherit from [`AssetBrid
| `l1Signer` | `parentSigner` |
| `l2Signer` | `childSigner` |

#### [`Erc20Bridger`](./assetBridger/erc20Bridger.md) Class Methods
#### [`Erc20Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/erc20Bridger.ts) Class Methods

| v3 Name | v4 Name |
| ----------------------- | --------------------------- |
Expand All @@ -116,7 +116,7 @@ The objects passed to the class methods of classes that inherit from [`AssetBrid
| `getL1GatewaySetEvents` | `getParentGatewaySetEvents` |
| `getL2GatewaySetEvents` | `getChildGatewaySetEvents` |

#### [`Erc20L1L3Bridger`](./assetBridger/l1l3Bridger.md) Class Methods
#### [`Erc20L1L3Bridger`](https://github.com/OffchainLabs/arbitrum-sdk/blob/main/packages/sdk/src/lib/assetBridger/l1l3Bridger.ts) Class Methods

| v3 Name | v4 Name |
| ------------------- | ------------------- |
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@
"@types/node": "^22.10.10",
"@types/react": "^19.0.10",
"@types/semver": "^7.7.0",
"docusaurus-plugin-typedoc": "^1.4.2",
"glob": "^7.2.0",
"gray-matter": "^4.0.3",
"husky": "^9.1.7",
"markdown-link-extractor": "^3.1.0",
Expand All @@ -96,9 +94,6 @@
"semver": "^7.6.0",
"styled-components": "^6.1.15",
"tsx": "^4.19.4",
"typedoc": "^0.28.16",
"typedoc-plugin-frontmatter": "^1.3.1",
"typedoc-plugin-markdown": "^4.9.0",
"typescript": "^5.1"
},
"resolutions": {
Expand Down
Loading
Loading