Skip to content

Commit

Permalink
Add ZKsync Era network support.
Browse files Browse the repository at this point in the history
Signed-off-by: bgravenorst <[email protected]>
  • Loading branch information
bgravenorst committed Jul 1, 2024
1 parent 20b69c6 commit a78dd60
Show file tree
Hide file tree
Showing 107 changed files with 20,176 additions and 20,020 deletions.
4 changes: 4 additions & 0 deletions docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The latest major MetaMask documentation updates are listed by the month they wer
For a comprehensive list of recent product changes, visit the "Release Notes" section at the bottom
of the [MetaMask developer page](https://metamask.io/developer/).

## July 2024

- Documented support for the [ZKsync Era network API service](/services/reference/zksync).

## June 2024

- Updated [React dapp with global state tutorial](/wallet/tutorials/react-dapp-global-state) with
Expand Down
1,162 changes: 1,038 additions & 124 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions services/get-started/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ Sepolia instead.
| Mainnet | JSON-RPC over HTTPS | `https://starknet-mainnet.infura.io/v3/<API-KEY>` |
| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://starknet-sepolia.infura.io/v3/<API-KEY>` |

## ZkSync Era

| Network | Description | URL |
|-------------------|---------------------|-------------------------------------------------|
| Mainnet | JSON-RPC over HTTPS | `https://zksync-mainnet.infura.io/v3/<API-KEY>` |
| Testnet (Sepolia) | JSON-RPC over HTTPS | `https://zksync-sepolia.infura.io/v3/<API-KEY>` |

## Gas API

Expand Down
2 changes: 1 addition & 1 deletion services/reference/arbitrum/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ No personal information is sent as part of partner requests, only information ne

For any parameters required in an RPC request, these could be the type that describe the method, addresses, gas, and session.

Liquify (Privacy Policy) is Infura's failover-protection partner and currently offer failover support for all Infura's Arbitrum methods.
Liquify ([Privacy Policy](https://www.liquify.com/Liquify_RPC_PP.pdf)) is Infura's failover-protection partner and currently offer failover support for all Infura's Arbitrum methods.
2 changes: 1 addition & 1 deletion services/reference/avalanche-c-chain/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ No personal information is sent as part of partner requests, only information ne

For any parameters required in an RPC request, these could be the type that describe the method, addresses, gas, and session.

Liquify (Privacy Policy) is Infura's failover-protection partner and currently offer failover support for all Infura's Avalanche (C-Chain) methods.
Liquify ([Privacy Policy](https://www.liquify.com/Liquify_RPC_PP.pdf)) is Infura's failover-protection partner and currently offer failover support for all Infura's Avalanche (C-Chain) methods.
2 changes: 1 addition & 1 deletion services/reference/optimism/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ No personal information is sent as part of partner requests, only information ne

For any parameters required in an RPC request, these could be the type that describe the method, addresses, gas, and session.

Bware Labs (Terms of Service, Privacy Policy) is Infura's failover-protection partner. While Bware Labs supports most Infura methods, it does not yet support the following methods:
Bware Labs ([Terms of Service](https://bwarelabs.com/terms), [Privacy Policy](https://bwarelabs.com/privacy)) is Infura's failover-protection partner. While Bware Labs supports most Infura methods, it does not yet support the following methods:

- `eth_accounts`
- `eth_coinbase`
Expand Down
5 changes: 4 additions & 1 deletion services/reference/polygon-pos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ No personal information is sent as part of partner requests, only information ne

For any parameters required in an RPC request, these could be the type that describe the method, addresses, gas, and session.

Rivet.Cloud (Terms of Service, Privacy Policy) is Infura's failover-protection partner. While Rivet.Cloud supports most Infura methods, it does not yet support the following methods:
<!-- markdown-link-check-disable -->
Rivet.Cloud ([Terms of Service](https://rivet.cloud/terms), [Privacy Policy](https://rivet.cloud/privacy-policy)) is Infura's failover-protection partner. While Rivet.Cloud supports most Infura methods,
it does not yet support the following methods:
<!-- markdown-link-check-enable -->

- `eth_accounts`
- `eth_coinbase`
Expand Down
51 changes: 51 additions & 0 deletions services/reference/zksync/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
description: ZKsync Era network documentation
---

import CardList from '@site/src/components/CardList'

# ZKsync Era

:::note Decentralized Infrastructure Network (DIN)

ZKsync Era is supported through the [DIN](https://www.infura.io/solutions/decentralized-infrastructure-service) service,
meaning calls to the network are routed to [partner infrastructure providers](#partners-and-privacy-policies).

Infura provides public beta access to ZKsync Era.
:::

ZKsync Era is a knowledge Ethereum Virtual Machine (zkEVM) that scales the experience of Ethereum.

:::info see also

See the [official ZKsync Era documentation](https://docs.zksync.io/build) for more information.

:::

<CardList
items={[
{
href: "quickstart",
title: "Quickstart",
description: "Learn how to quickly connect and make calls to the ZKsync Era network."
},
{
href: "json-rpc-methods",
title: "JSON-RPC APIs",
description: "View the APIs available for communicating with the ZKsync Era network."
},
{
href: "../../../developer-tools/dashboard/get-started/create-api/",
title: "Create an API key",
description: "Learn how to create an API key and secure and share it with your team."
}
]}
/>

## Partners and privacy policies

The following partners provide access to the ZKsync Era network:
<!-- markdown-link-check-disable -->
- Chainstack ([Terms of Use](https://chainstack.com/tos/), [Privacy Policy](https://chainstack.com/privacy/))
- Bware Labs ([Terms of Service](https://bwarelabs.com/terms), [Privacy Policy](https://bwarelabs.com/privacy))
<!-- markdown-link-check-enable -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}'
```

</TabItem>

</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params": [],"id":1}'
```

</TabItem>

</Tabs>

16 changes: 16 additions & 0 deletions services/reference/zksync/json-rpc-methods/_eth_call-request.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_call","params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas": "0x76c0","gasPrice": "0x9184e72a000","value": "0x9184e72a","data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_chainId","params": [],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_estimateGas","params": [{"from": "0x9cE564c7d09f88E7d8233Cdd3A4d7AC42aBFf3aC","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","value": "0x9184e72a"}],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"id": 1, "jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x5", "latest", [20,30]] }'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_gasPrice","params": [],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",false],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x5BAD55",false],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params": ["latest"],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getCode","params": ["0x06012c8cf97bead5deae237070f9587f8e7a266d", "0x65a8db"],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}],"id":1}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0","method": "eth_getProof","id": 1,"params": ["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842", ["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"], "latest"]}'
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="cURL">

```bash
curl https://zksync-mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getStorageAt","params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "0x65a8db"],"id":1}'
```

</TabItem>
</Tabs>

Loading

0 comments on commit a78dd60

Please sign in to comment.