1.0.0 • Published 8 months ago

wagmi-sapphire-provider v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

Wagmi Sapphire Paratime

A library to use Sapphire ParaTime with Wagmi

Getting started

npm install wagmi-sapphire-provider

How to use it

import { sapphireJsonRpcProvider } from 'wagmi-sapphire-provider';

const sapphireTestnet = {
    id: 23295,
    name: 'SapphireTestnet',
    network: 'SapphireTestnet',
    nativeCurrency: {
      name: 'TEST',
      symbol: '$',
      decimals: 18,
    },
    rpcUrls: {
      default: 'https://testnet.sapphire.oasis.dev',
    },
    testnet: true,
    blockExplorers: {
      default: { name: 'Sapphire Explorer', url: 'https://testnet.explorer.sapphire.oasis.dev' }
    }
  };

const { chains, provider } = configureChains(
    [sapphireTestnet],
    [
      sapphireJsonRpcProvider({
        rpc: (chain) => {
          return { http: chain.rpcUrls.default };
        },
      }),
    ],
  );