Quickstart Guide

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

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

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

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

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

NOTE

In Windows Powershell, quotations in curl commands can behave differently than expected. We recommend using Postman on Windows systems.

Call the JSON-RPC methods using Postmanarrow-up-right.

INFO: Set the correct variablesarrow-up-right for your API key and network before running requests.

Node (JavaScript)​arrow-up-right

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

  1. In your project folder, install the Node Fetch 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 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:

  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. Create your Javascript file and copy the following code:

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

    index.js

  2. Run the code using the following command:

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

  2. Create your Python 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