Quickstart Guide

This quickstart guide will help you set up and make calls on the ZKsync network using the Liquify Gateway endpoints.

Ensure you have an API key with the ZKsync network enabled.

Run the following command in your terminal. This command will retrieve the latest block number from the ZKsync network.

Replace YOUR-API-KEY with your actual Liquify Gateway API key.

curl https://gateway.liquify.com/YOUR-API-KEY \
https://gateway.liquify.com/
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Node (JavaScript)​arrow-up-right

In these examples, you'll use npmarrow-up-right as your package manager.

Node Fetch​arrow-up-right

  1. In your project folder, install the Node Fetch package using npm:

    npm i node-fetch
  2. Create your Javascript file and copy the following code:

    Replace YOUR-API-KEY with your actual Liquify Gateway API key.

    index.js

    import fetch from 'node-fetch';
    
    fetch("https://gateway.liquify.com/YOUR-API-KEY", {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        jsonrpc: "2.0",
        method: "eth_blockNumber",
        params: [],
        id: 1
      })
    })
    .then(response =>
      response.json()
    )
    .then(data => {
      console.log(data);
    })
    .catch(error => {
      console.error(error);
    });
  3. Run the code using the following command:

    node index.js

Axios​arrow-up-right

  1. In your project folder, install the Axios package using npm:

  2. Create your Javascript file and copy the following code:

    Replace YOUR-API-KEY with your actual Liquify Gateway API key.

    index.js

  3. Run the code using the following command:

Ethers​arrow-up-right

  1. In your project folder, install the ethers package using npm:

  2. Create your Javascript file and copy the following code:

    Replace YOUR-API-KEY with your actual Liquify Gateway API key.

    index.js

  3. Run the code using the following command:

  1. In your project folder, install the requests library:

  2. Create your Javascript file and copy the following code:

    Replace YOUR-API-KEY with your actual Liquify Gateway API key.

    index.py

  3. Run the code using the following command:

Last updated