â„šī¸
Liquify
  • 😎Welcome to Liquify Gateway
    • Why Liquify Gateway?
    • Why Liquify?
    • Why Pocket Network POKT?
  • 💁RPC Quickstart Guide
    • Create a Liquify Gateway Account
    • Liquify Gateway Dashboard
    • Account Customisation
    • Create an RPC Endpoint
    • Delete an RPC Endpoint
  • SUPPORTED CHAINS
    • â›“ī¸Chainlist
      • Ethereum
        • Quickstart Guide
      • Polygon (PoS)
        • Quickstart Guide
      • Arbitrum
        • Quickstart Guide
      • Base
        • Quickstart Guide
      • BNB Chain
        • Quickstart Guide
      • Klaytn
        • Quickstart Guide
      • DFK Chain
        • Quickstart Guide
      • Fuse
        • Quickstart Guide
      • Solana
        • Quickstart Guide
  • Connect With Liquify.io
    • Medium
    • Github
    • X / Twitter
    • The Deep Dive Podcast
    • Contact Us
    • liquify.io
    • Liquify Early Adopters Program (LEAP)
Powered by GitBook
On this page
  • Prerequisites​
  • Make calls​
  1. SUPPORTED CHAINS
  2. Chainlist
  3. Polygon (PoS)

Quickstart Guide

This quickstart guide will help you set up and make calls on the Polygon (PoS) network using the Liquify Gateway endpoints.

PreviousPolygon (PoS)NextArbitrum

Last updated 1 year ago

Prerequisites

Ensure you with the Polygon network enabled.

Make calls

cURL

Run the following command in your terminal. This command will retrieve the latest block number from the Polygon 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)

In these examples,you'll use as your package manager.

Node Fetch

  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
  1. In your project folder, install the Axios package using npm:

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

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

    index.js

    const axios = require('axios');
    
    axios.post('https://gateway.liquify.com/YOUR-API-KEY', {
      jsonrpc: '2.0',
      method: 'eth_blockNumber',
      params: [],
      id: 1
    })
    .then(response => {
      console.log(response.data);
    })
    .catch(error => {
      console.error(error);
    });
  3. Run the code using the following command:

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

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

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

    index.js

    const ethers = require('ethers');
    
    const provider = new ethers.providers.JsonRpcProvider('https://gateway.liquify.com/YOUR-API-KEY');
    
    provider.getBlockNumber()
    .then(blockNumber => {
      console.log(blockNumber);
    })
    .catch(error => {
      console.error(error);
    });
  3. Run the code using the following command:

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

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

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

    index.py

    import requests
    import json
    
    url = 'https://gateway.liquify.com/YOUR-API-KEY'
    
    payload = {
        "jsonrpc": "2.0",
        "method": "eth_blockNumber",
        "params": [],
        "id": 1
    }
    
    headers = {'content-type': 'application/json'}
    
    response = requests.post(url, data=json.dumps(payload), headers=headers).json()
    
    print(response)
  3. Run the code using the following command:

    python index.py

Axios

Ethers

Python

â›“ī¸
​
have an API key
​
​
​
npm
​
​
​
​