- Build the package:
cd packages/overlay-sdk
pnpm run build
- Link the package to react application
cd ../../apps/overlay
pnpm add overlay-sdk
To get started with the Overlay SDK import the necessary module:
import { OverlaySDK } from 'overlay-sdk'
Before using the SDK create an instance of the OverlaySDK class:
// Pass your own viem PublicClient
import { createPublicClient, http } from "viem";
import { arbitrumSepolia } from "viem/chains";
const rpcProvider = createPublicClient({
chain: arbitrumSepolia,
transport: http(),
});
const web3Provider = window.ethereum;
const sdk = new OverlaySDK({
chainId: 421614,
rpcProvider,
web3Provider,
});
Custom RPC
import { OverlaySDK, CHAINS } from "overlay-sdk";
const web3Provider = window.ethereum;
const sdk = new OverlaySDK({
chainId: CHAINS.Bartio,
rpcUrls: {
[CHAINS.ArbitrumSepolia]: 'https://arb-sepolia.g.alchemy.com/v2/xxx',
[CHAINS.Bartio]: 'https://bera-testnet.nodeinfra.com',
},
web3Provider,
});