This guide will walk you through the process of configuring a provider and RPC correctly for networks of your choice

Overview

Para supports a bring-your-own RPC model. This makes it easy to use Para with any network (at any stage), from internal devnets to any major mainnet network.

Prerequisites

Before you begin, ensure you have:

If you haven’t set up Para authentication yet, complete one of our authentication tutorials first and return to this guide when you’re ready to add transaction signing.

Ethers

For Ethers, just provide the RPC URL for your desired chain

import { ParaEthersSigner } from "@getpara/ethers-v6-integration";
import { ethers } from "ethers";
import Para from "@getpara/web-sdk";

// Initialize Para
const para = new Para(Environment.BETA, YOUR_API_KEY);

// Set up the provider
const provider = new ethers.JsonRpcProvider(YOUR_RPC_URL);

// Create the Para Ethers Signer
const ethersSigner = new ParaEthersSigner(para, provider);

Viem

To configure a custom chain, just add a new Chain type as follows (Reference List)

// source: https://wagmi.sh/core/api/chains
import { defineChain } from 'viem'

export const mainnet = defineChain({
  id: 1,
  name: 'Ethereum',
  nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
  rpcUrls: {
    default: { http: ['https://cloudflare-eth.com'] },
  },
  blockExplorers: {
    default: { name: 'Etherscan', url: 'https://etherscan.io' },
  },
  contracts: {
    ensRegistry: {
      address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
    },
    ensUniversalResolver: {
      address: '0xE4Acdd618deED4e6d2f03b9bf62dc6118FC9A4da',
      blockCreated: 16773775,
    },
    multicall3: {
      address: '0xca11bde05977b3631167028862be2a173976ca11',
      blockCreated: 14353601,
    },
  },
})

// Create the Para Viem Client
const paraViemSigner = createParaViemClient(para, {
  account: viemParaAccount,
  chain: mainnet,
  transport: http("https://cloudflare-eth.com"),
});

This chain configuration can now be passed to a viem provider (See Docs)

Wagmi

If you’re also already using wagmi, you can easily extend @wagmi/chains (Reference Docs) and automatically use Para signers directly with your desired set of supported chains

import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { paraConnector } from "@getpara/wagmi-v2-integration";
import { createConfig, WagmiProvider, type CreateConfigParameters } from "wagmi";
import { http } from "wagmi";
import { sepolia, mainnet } from "wagmi/chains";
import { para } from "./para"; // Your Para client initialization

// Create Para connector
const chains = [sepolia, mainnet]

// see wagmi integration guide for full config options
const connector = paraConnector({
  para: para,
  chains, // Add your supported chains
  appName: "Your App Name",
  options: {},
  nameOverride: "Para",
  idOverride: "para",
});

// Configure Wagmi
const config: CreateConfigParameters = {
  chains: chains,
  connectors: [connector],
  transports: {
    [sepolia.id, mainnet.id]: http(),
  },
};

const wagmiConfig = createConfig(config);
const queryClient = new QueryClient();

Solana-Web3.js

Instantiate the Solana-Web3,js signer with your network’s RPC URL of choice

import { ParaSolanaWeb3Signer } from "@getpara/solana-web3.js-v1-integration";
import { Connection, clusterApiUrl } from "@solana/web3.js";
import { para } from "./para"; // Your Para client initialization

// Set up SVM connection
const solanaConnection = new Connection(YOUR_RPC_URL);

// Create the Para Solana Signer
const solanaSigner = new ParaSolanaWeb3Signer(para, solanaConnection);

CosmJS

Initialize the signing client with your RPC URL of choice

import { ParaProtoSigner } from "@getpara/cosmjs-v0-integration";
import { SigningStargateClient } from "@cosmjs/stargate";

// Create the Para Proto Signer
// 'prefix' is optional and used for non-cosmos addresses (e.g., 'celestia' for celestia1... addresses)
const protoSigner = new ParaProtoSigner(para, "cosmos");

// Connect to the Cosmos network
const rpcUrl = YOUR_RPC_URL; // Replace with your preferred RPC endpoint
const client = await SigningStargateClient.connectWithSigner(rpcUrl, protoSigner);