![Switchboard Logo](https://github.com/switchboard-xyz/sbv2-core/raw/main/website/static/img/icons/switchboard/avatar.png)
@switchboard-xyz/evm.js
A Typescript client to interact with Switchboard on EVM based chains.
![NPM Badge](https://img.shields.io/github/package-json/v/switchboard-xyz/evm-sdk?color=red&filename=javascript%2Fevm.js%2Fpackage.json&label=%40switchboard-xyz%2Fevm.js&logo=npm)
Install
npm i --save @switchboard-xyz/evm.js
Usage
Directory
Load Switchboard Contract and Switchboard Push Receiver Contract Functions
import ethers from "ethers";
import {
getSwitchboard,
getSwitchboardPushReceiver,
getSwitchboardPushReceiverFeeds,
} from "@switchboard-xyz/evm.js";
const signer = new ethers.Wallet(privateKey);
const switchboardProgram = await getSwitchboard(
process.env.SWITCHBOARD_ADDRESS,
signer
);
const switchboardPushReceiver = await getSwitchboardPushReceiver(
process.env.SWITCHBOARD_PUSH_ADDRESS,
signer
);
const allFeeds = await getSwitchboardPushReceiverFeeds(switchboardPushReceiver);
console.log(allFeeds);