open-index/open-npm huggingface dataset:
npm package: @switchappgo/switchapp-client
Description: TypeScript client library for SwitchApp API
Author: SwitchApp Tech Solutions Ltd
Latest version: 1.0.4

# SwitchApp Client

TypeScript client library for SwitchApp API

## Installation

```bash
npm install switchapp-client
```

## Usage

```typescript
import { SwitchAppClient } from 'switchapp-client';

const client = new SwitchAppClient({
  apiKey: 'your-secret-api-key', // sk_text_xxxxxxxxx | sk_live_xxxxxxxxx
});
```

## Development

```bash
# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm run test

# Lint code
npm run lint

# Format code
npm run format
```

## License

MIT
npm package: @switchboard-xyz/aptos-sdk
Description: API wrapper for intergating with the Switchboard program on our Aptos implementation
Latest version: 0.1.5

<div align="center">

![Switchboard Logo](https://github.com/switchboard-xyz/switchboard/raw/main/website/static/img/icons/switchboard/avatar.png)

# Switchboard Aptos SDK

## [Typedoc](https://switchboard-aptos-sdk.web.app)


## Installation

```bash
pnpm install @switchboard-xyz/aptos-sdk
```
npm package: @switchboard-xyz/common
Description: common type definitions and utils for interacting with switchboard
Latest version: 5.7.0

<div align="center">
  <a href="#">
    <img src="https://github.com/switchboard-xyz/sbv2-core/raw/main/website/static/img/icons/switchboard/avatar.png" />
  </a>

  <h1>@switchboard-xyz/common</h1>

  <p>Contains the OracleJob protobufs and other types and utilities shared across chains.</p>

  <p>
	<a href="https://www.npmjs.com/package/@switchboard-xyz/common">
      <img alt="NPM Badge" src="https://img.shields.io/github/package-json/v/switchboard-xyz/sbv2-core?color=red&filename=javascript%2Fcommon%2Fpackage.json&label=%40switchboard-xyz%2Fcommon&logo=npm" />
    </a>
  </p>

  <p>
    <a href="https://discord.gg/switchboardxyz">
      <img alt="Discord" src="https://img.shields.io/discord/841525135311634443?color=blueviolet&logo=discord&logoColor=white" />
    </a>
    <a href="https://twitter.com/switchboardxyz">
      <img alt="Twitter" src="https://img.shields.io/twitter/follow/switchboardxyz?label=Follow+Switchboard" />
    </a>
  </p>

  <h4>
    <strong>Npm: </strong><a href="https://www.npmjs.com/package/@switchboard-xyz/common">npmjs.com/package/@switchboard-xyz/common</a>
  </h4>
  <h4>
    <strong>Typedocs: </strong><a href="https://switchboardxyz-common.netlify.app">switchboardxyz-common.netlify.app</a>
  </h4>
</div>

## Install

```bash
npm i --save @switchboard-xyz/common
```

## Usage

### Create an OracleJob

```ts
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

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

const result = await simulateOracleJobs([oracleJob]);
console.log(result);
```
npm package: @switchboard-xyz/eslint-config
Description: Switchboard eslint-config
Latest version: 0.1.9

# Switchboard Eslint Config

## Install

```bash
npm i --save-dev @switchboard-xyz/eslint-config gts
```

Create `.eslintrc.json`

```json
{
  "extends": "@switchboard-xyz"
}
```

## Usage

Add the following script to your `package.json`

```json
{
  "lint": "gts lint ./src",
  "fix": "gts fix ./src",
  "clean": "gts clean"
}
```
npm package: @switchboard-xyz/evm.js
Description: API wrapper for intergating with the Switchboard program on our EVM implementation
Latest version: 3.12.36

<div align="center">

![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)](https://www.npmjs.com/package/@switchboard-xyz/evm.js)

</div>

## Install

```bash
npm i --save @switchboard-xyz/evm.js
```

## Usage

**Directory**

- [Load Switchboard Contract and Switchboard Push Receiver Contract Functions](#load-switchboard-contract-and-switchboard-push-receiver-contract-functions)

### Load Switchboard Contract and Switchboard Push Receiver Contract Functions

```ts
import ethers from "ethers";
import {
  getSwitchboard,
  getSwitchboardPushReceiver,
  getSwitchboardPushReceiverFeeds,
} from "@switchboard-xyz/evm.js";

const signer = new ethers.Wallet(privateKey);

// get switchboard contract functions
const switchboardProgram = await getSwitchboard(
  process.env.SWITCHBOARD_ADDRESS, // Switchboard contract address (from environment)
  signer // Signer instance
);

// get switchboard feeds contract functions
const switchboardPushReceiver = await getSwitchboardPushReceiver(
  process.env.SWITCHBOARD_PUSH_ADDRESS,
  signer
);

// log all feeds
const allFeeds = await getSwitchboardPushReceiverFeeds(switchboardPushReceiver);
console.log(allFeeds); // Feed[];
```
npm package: @switchboard-xyz/iota-sdk
Description: API wrapper for intergating with the Switchboard program on our Iota implementation
Latest version: 0.0.3

<div align="center">

![Switchboard Logo](https://github.com/switchboard-xyz/switchboard/raw/main/website/static/img/icons/switchboard/avatar.png)

# Switchboard Sui SDK

Typedoc: https://switchboard-sui-sdk.web.app

## Installation

```bash
pnpm install @switchboard-xyz/sui-sdk
```
npm package: @switchboard-xyz/oracle
Description: Switchboard oracle module
Author: mitch@switchboard.xyz
Latest version: 2.1.14
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<div align="center">
  <a href="#">
    <img src="https://github.com/switchboard-xyz/sbv2-core/raw/main/website/static/img/icons/switchboard/avatar.png" />
  </a>

  <h1>@switchboard-xyz/oracle</h1>

  <p>A Typescript wrapper for the Switchboard V2 oracle.</p>

  <p>
    <img alt="Test Status" src="https://github.com/switchboard-xyz/sbv2-solana/actions/workflows/solana-js-test.yml/badge.svg" />
	  <a href="https://www.npmjs.com/package/@switchboard-xyz/solana.js">
      <img alt="NPM Badge" src="https://img.shields.io/github/package-json/v/switchboard-xyz/sbv2-solana?color=red&filename=javascript%2Fsolana.js%2Fpackage.json&label=%40switchboard-xyz%2Fsolana.js&logo=npm" />
    </a>
  </p>

  <p>
    <a href="https://discord.gg/switchboardxyz">
      <img alt="Discord" src="https://img.shields.io/discord/841525135311634443?color=blueviolet&logo=discord&logoColor=white" />
    </a>
    <a href="https://twitter.com/switchboardxyz">
      <img alt="Twitter" src="https://img.shields.io/twitter/follow/switchboardxyz?label=Follow+Switchboard" />
    </a>
  </p>

  <h4>
    <strong>Npm: </strong><a href="https://www.npmjs.com/package/@switchboard-xyz/solana.js">npmjs.com/package/@switchboard-xyz/oracle</a>
  </h4>
  <h4>
    <strong>Sbv2 SDK: </strong><a href="https://github.com/switchboard-xyz/sbv2-core">github.com/switchboard-xyz/sbv2-core</a>
  </h4>
</div>

## Install

```bash
npm i --save-dev @switchboard-xyz/oracle
```

## Usage

### NodeJS

```ts
import { NodeOracle } from "@switchboard-xyz/oracle";

const oracle = await NodeOracle.fromReleaseChannel({
  releaseChannel: "testnet",
  chain: "solana",
  network: "localnet",
  rpcUrl: "http://0.0.0.0:8899",
  oracleKey: "FKFPBD5WUUL5bSNwBH3AKY58KuY8nz2zkMCYR271CcVA",
  secretPath: "~/.config/solana/id.json",
});

try {
  await oracle.startAndAwait();
  console.log("oracle ready");
  await sleep(10000);
} catch (error) {
  console.error(error);
}

oracle.stop();
```

### Docker

```ts
import { DockerOracle } from "@switchboard-xyz/oracle";

const oracle = await DockerOracle.fromReleaseChannel({
  releaseChannel: "testnet",
  chain: "solana",
  network: "localnet",
  rpcUrl: "http://0.0.0.0:8899",
  oracleKey: "FKFPBD5WUUL5bSNwBH3AKY58KuY8nz2zkMCYR271CcVA",
  secretPath: "~/.config/solana/id.json",
});

try {
  await oracle.startAndAwait();
  console.log("oracle ready");
  await sleep(10000);
} catch (error) {
  console.error(error);
}

oracle.stop();
```
npm package: @switchboard-xyz/starknet-sdk
Description: API wrapper for intergating with the Switchboard program on our Starknet implementation
Latest version: 0.1.0

<div align="center">

![Switchboard Logo](https://github.com/switchboard-xyz/switchboard/raw/main/website/static/img/icons/switchboard/avatar.png)

# Switchboard Starknet SDK

## Installation

```bash
pnpm install @switchboard-xyz/starknet-sdk
```
npm package: @switchboard-xyz/starknet.js
Description: Typescript client to interact with Switchboard on Starknet.
Latest version: 1.0.1

<div align="center">

![Switchboard Logo](https://github.com/switchboard-xyz/sbv2-core/raw/main/website/static/img/icons/switchboard/avatar.png)

<h1>@switchboard-xyz/starknet.js</h1>

A Typescript client to interact with Switchboard on Starknet.

<p>
    <a href="https://www.npmjs.com/package/@switchboard-xyz/starknet.js">
        <img alt="NPM" src="https://img.shields.io/github/package-json/v/switchboard-xyz/starknet-sdk?color=red&filename=javascript%2Fstarknet.js%2Fpackage.json&label=%40switchboard-xyz%2Fstarknet.js&logo=npm">
    </a>
    <br/>
    <a href="https://discord.gg/switchboardxyz">
        <img alt="Discord" src="https://img.shields.io/discord/841525135311634443?color=blueviolet&logo=discord&logoColor=white">
    </a>
    <a href="https://twitter.com/switchboardxyz">
        <img alt="Twitter" src="https://img.shields.io/twitter/follow/switchboardxyz?label=Follow+Switchboard" />
    </a>
</p>
</div>

## Install

```bash
npm i --save @switchboard-xyz/starknet.js
```

## Usage

TODO: Finish out the usage here.
npm package: @switchboard-xyz/x402-utils
Description: Utilities for handling HTTP 402 Payment Required responses with the faremeter payment protocol
Latest version: 0.3.0

# @switchboard-xyz/x402-utils

Utilities for handling HTTP 402 Payment Required responses with the faremeter payment protocol.

## Installation

```bash
pnpm add @switchboard-xyz/x402-utils
```

## Usage

```typescript
import { X402FetchManager } from '@switchboard-xyz/x402-utils';
import { exact } from '@faremeter/payment-solana';
import { createLocalWallet } from '@faremeter/wallet-solana';

// Create a wallet and payment handler
const wallet = createLocalWallet();
const paymentHandler = exact({ wallet });

// Create the fetch manager
const fetchManager = new X402FetchManager(paymentHandler);

// Make a request - payments are handled automatically
const response = await fetchManager.fetch('https://api.example.com/data', {
  method: 'GET',
  headers: { 'Accept': 'application/json' }
});

const data = await response.json();
console.log(data);
```

## API

### `X402FetchManager`

A class that wraps the fetch API to automatically handle payment negotiations.

#### Constructor

```typescript
new X402FetchManager(paymentHandler: client.PaymentHandler)
```

- `paymentHandler`: The payment handler to use for processing 402 responses

#### Methods

##### `fetch(url: string, params?: RequestInit): Promise<Response>`

Executes an HTTP request with automatic payment handling.

##### `derivePaymentHeader(url: string, params?: RequestInit): Promise<string>`

Derives the X-PAYMENT header that would be generated for a given request. Useful for debugging.

##### `fetchX402Info(url: string, params?: RequestInit): Promise<X402PaymentDetails>`

Extracts the x402 payment information from a 402 Payment Required response. This method makes a request expecting a 402 status code and returns the parsed JSON body containing the payment details.

```typescript
const paymentInfo = await fetchManager.fetchX402Info(
  'https://api.example.com/data',
  { method: 'GET' }
);
console.log('Payment details:', paymentInfo);
// Returns:
// {
//   accepts: [
//     {
//       scheme: 'deferred',
//       network: 'solana',
//       resource: 'https://api.example.com/data',
//       amount: '1000000',
//       token: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
//       recipient: '...'
//     }
//   ]
// }
```

### Types

#### `X402PaymentDetails`

Interface representing the payment details returned in a 402 Payment Required response:

```typescript
interface X402PaymentDetails {
  accepts: Array<{
    scheme: string;          // Payment scheme (e.g., "deferred")
    network: string;         // Blockchain network (e.g., "solana", "ethereum")
    resource: string;        // Resource URL being paid for
    amount?: string;         // Payment amount in smallest unit
    token?: string;          // Token contract/mint address
    recipient?: string;      // Payment recipient address
    extras?: Record<string, unknown>;  // Additional metadata
    [key: string]: unknown;  // Other fields
  }>;
}
```

## License

MIT
npm package: @switchbox/react
Description: React hooks and components for Switchbox feature flags.
Latest version: 0.1.1

# @switchbox/react

React hooks and components for Switchbox feature flags.

Thin wrapper over [switchbox-js](https://www.npmjs.com/package/switchbox-js) — no evaluation logic, no networking, just React primitives.

## Install

```bash
npm install switchbox-js @switchbox/react
```

## Setup

```tsx
import { createClient } from 'switchbox-js';
import { SwitchboxProvider } from '@switchbox/react';

const client = await createClient({
  cdnUrl: 'https://cdn.switchbox.dev/<sdk_key>/flags.json',
});

function App() {
  return (
    <SwitchboxProvider client={client}>
      <MyApp />
    </SwitchboxProvider>
  );
}
```

## Hooks

### useFlag

```tsx
import { useFlag } from '@switchbox/react';

function Checkout() {
  const showNew = useFlag('new_checkout', { user_id: '42' });
  return showNew ? <NewCheckout /> : <OldCheckout />;
}
```

### useValue

```tsx
import { useValue } from '@switchbox/react';

function Dashboard() {
  const theme = useValue('theme', { user_id: '42' }, 'light');
  return <div className={theme}>...</div>;
}
```

### useClient

```tsx
import { useClient } from '@switchbox/react';

function Advanced() {
  const client = useClient();
  // Access the underlying switchbox-js Client directly
}
```

## Components

### Feature

Declarative flag-based rendering:

```tsx
import { Feature } from '@switchbox/react';

function Dashboard() {
  return (
    <Feature flag="new_dashboard" user={{ user_id: '42' }} fallback={<OldDashboard />}>
      <NewDashboard />
    </Feature>
  );
}
```

## License

MIT
npm package: @switchcase/node-native-loader
Description: A webpack loader for node native modules (.node/C++ binaries).
Author: Travis Collins
Latest version: 1.1.5

# node-native-loader

A webpack loader for node native modules (.node/C++ binaries).

## What it does

This loader moves all relevant files (generally, `.node` files) to the output path, then uses
relative paths to load them, so that they can be loaded in a consistent location across different
builds of an app (development vs packaged, etc.).

It is similar to [node-relative-loader](https://www.npmjs.com/package/node-relative-loader), but
has a number of problematic options removed, and works consistently on Windows (whereas the
aforementioned module often generates non-working require statements).

## Usage

```javascript
// In your webpack config

// For an application that outputs files to ./app/dist, and starts from ./app/index:
const config = {
  // ...
  module: {
    loaders: {
      // ...
      {
        test: /\.node$/,
        // `from` is where paths will be made relative to
        loader: 'node-native?from=app',
      },
    }
  }
}
```

## A note on webpack-dev-server

If you're using `webpack-dev-server` (or `webpack-dev-middleware`), you probably also want to add
[write-file-webpack-plugin](https://www.npmjs.com/package/write-file-webpack-plugin) to your
configuration for all `.node` files, so that they still get written to the filesystem and can be
required consistently.

## License

MIT
npm package: @switchcase/prettier-config
Description: SwitchCase Prettier Configuration
Author: SwitchCase Group, LLC
Latest version: 0.1.18

# `@switchcase/prettier-config`

> SwitchCase [Prettier](https://prettier.io) config as per [Support shared configurations](https://prettier.io/blog/2019/04/12/1.17.0.html#support-shared-configurations-5963-by-azz)

## Usage

**Install**:

```bash
$ yarn add --dev @switchcase/prettier-config
```

**Edit `package.json`**:

```jsonc
{
  // ...
  "prettier": "@switchcase/prettier-config"
}
```