Contains the OracleJob protobufs and other types and utilities shared across chains.
Typedocs: docs.switchboard.xyz/api/common
npm i --save @switchboard-xyz/common
import { OracleJob, serializeOracleJob } from "@switchboard-xyz/common";
const oracleJob: OracleJob = serializeOracleJob({
tasks: [
{
httpTask: {
url: "https://www.binance.com/api/v3/ticker/price?symbol=BTCUSDT",
},
},
{
jsonParseTask: {
path: "$.price",
},
},
{
multiplyTask: {
/* Mainnet USDT/USD Feed */
aggregatorPubkey: "ETAaeeuQBwsh9mC2gCov9WdhJENZuffRMXY2HgjCcSL9",
},
},
],
});
import { simulateOracleJobs } from "@switchboard-xyz/common";
const result = await simulateOracleJobs([oracleJob]);
console.log(result);