Skip to main content

Documentation Index

Fetch the complete documentation index at: https://polynode.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

https://rpc.polynode.dev
All requests require a valid API key via x-api-key header or Authorization: Bearer header.

Integration Examples

import { createPublicClient, createWalletClient, http } from 'viem'
import { polygon } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'

const transport = http('https://rpc.polynode.dev', {
  fetchOptions: {
    headers: { 'x-api-key': 'YOUR_API_KEY' }
  }
})

// Read contract state
const publicClient = createPublicClient({
  chain: polygon,
  transport
})

const blockNumber = await publicClient.getBlockNumber()
const balance = await publicClient.getBalance({
  address: '0xYOUR_ADDRESS'
})

// Send transactions with priority routing
const account = privateKeyToAccount('0xYOUR_PRIVATE_KEY')
const walletClient = createWalletClient({
  account,
  chain: polygon,
  transport
})

const hash = await walletClient.sendTransaction({
  to: '0xRECIPIENT',
  value: parseEther('1.0')
})

Hardhat / Foundry

// hardhat.config.js
module.exports = {
  networks: {
    polygon: {
      url: 'https://rpc.polynode.dev',
      accounts: [process.env.PRIVATE_KEY],
      chainId: 137,
      httpHeaders: {
        'x-api-key': process.env.POLYNODE_API_KEY
      }
    }
  }
}

Response Format

Standard Ethereum JSON-RPC responses:
// Success
{"jsonrpc": "2.0", "id": 1, "result": "0x..."}

// Error
{"jsonrpc": "2.0", "id": 1, "error": {"code": -32000, "message": "..."}}