New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@switchboard-xyz/common

Package Overview
Dependencies
Maintainers
0
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@switchboard-xyz/common

common type definitions and utils for interacting with switchboard

3.0.4
npm
Version published
Weekly downloads
8.2K
-18.84%
Maintainers
0
Weekly downloads
 
Created
Source

@switchboard-xyz/common

Contains the OracleJob protobufs and other types and utilities shared across chains.

NPM Badge

Discord Twitter

Npm: npmjs.com/package/@switchboard-xyz/common
Typedocs: docs.switchboard.xyz/api/@switchboard-xyz/common

Install

npm i --save @switchboard-xyz/common

Usage

Create an OracleJob

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",
      },
    },
  ],
});

Simulate an OracleJob

import { simulateOracleJobs } from "@switchboard-xyz/common";

const result = await simulateOracleJobs([oracleJob]);
console.log(result);

FAQs

Package last updated on 06 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts