https://github.com/switchboard-xyz/solana-sdk
Switchboard V2 SDK for the Solana Blockchain
https://github.com/switchboard-xyz/solana-sdk
Last synced: about 1 month ago
JSON representation
Switchboard V2 SDK for the Solana Blockchain
- Host: GitHub
- URL: https://github.com/switchboard-xyz/solana-sdk
- Owner: switchboard-xyz
- License: mit
- Created: 2022-04-05T21:32:04.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-29T00:15:32.000Z (over 1 year ago)
- Last Synced: 2024-04-14T04:07:30.174Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 30.6 MB
- Stars: 51
- Watchers: 6
- Forks: 33
- Open Issues: 47
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-solana - Switchboard - xyz/switchboard-v2.svg?style=social) ([docs](https://docs.switchboard.xyz/)) Switchboard provides a permission-less data layer to bridge the gap between the internet and web3. (Code / Oracles)
README

# Switchboard x Solana
> A collection of libraries and examples for interacting with Switchboard V2 on
> Solana.[](https://github.com/switchboard-xyz/sbv2-solana/actions/workflows/solana-js-test.yml)
[](https://github.com/switchboard-xyz/sbv2-solana/actions/workflows/anchor-test.yml)[](https://crates.io/crates/switchboard-v2)
[](https://www.npmjs.com/package/@switchboard-xyz/solana.js)## Getting Started
To get started, clone the
[sbv2-solana](https://github.com/switchboard-xyz/sbv2-solana) repository.```bash
git clone https://github.com/switchboard-xyz/sbv2-solana
```Then install the dependencies
```bash
cd sbv2-solana
pnpm install
pnpm build
```## Addresses
The following addresses can be used with the Switchboard deployment on Solana
### Mainnet
| Account | Address |
| -------------------- | ---------------------------------------------- |
| Program ID | `SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f` |
| Program Authority | `2NvGRFswVx3GXxURNSfjbsWY4iP1ufj8LvAKJWGXSm4D` |
| IdlAddress | `Fi8vncGpNKbq62gPo56G4toCehWNy77GgqGkTaAF5Lkk` |
| Permissioned Queue | `3HBb2DQqDfuMdzWxNk1Eo9RTMkFYmuEAd32RiLKn9pAn` |
| Permissionless Queue | `5JYwqvKkqp35w8Nq3ba4z1WYUeJQ1rB36V8XvaGp6zn1` |### Devnet
| Account | Address |
| -------------------- | ---------------------------------------------- |
| Program ID | `SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f` |
| Program Authority | `2KgowxogBrGqRcgXQEmqFvC3PGtCu66qERNJevYW8Ajh` |
| IdlAddress | `Fi8vncGpNKbq62gPo56G4toCehWNy77GgqGkTaAF5Lkk` |
| Permissioned Queue | `PeRMnAqNqHQYHUuCBEjhm1XPeVTh4BxjY4t4TPan1pG` |
| Permissionless Queue | `uPeRMdfPmrPqgRWSrjAnAkH78RqAhe5kXoW6vBYRqFX` |## Clients
| **Lang** | **Name** | **Description** |
| ---------- | -------------------------------------------------- | ------------------------------------------------------------------ |
| Rust | [switchboard-v2](rust/switchboard-v2) | A Rust library to interact with Switchboard V2 accounts on Solana. |
| Javascript | [@switchboard-xyz/solana.js](javascript/solana.js) | A Typescript client to interact with Switchboard on Solana. |## Examples
| **Lang** | **Name** | **Description** |
| ---------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| Rust | [native-feed-parser](programs/native-feed-parser) | Read a Switchboard feed using Solana's native program library |
| Anchor | [anchor-feed-parser](programs/anchor-feed-parser) | Read a Switchboard feed using Anchor |
| Anchor | [anchor-history-parser](programs/anchor-history-parser) | Read a data feeds history buffer and get the closest historical sample to a given timestamp |
| Anchor | [anchor-vrf-parser](programs/anchor-vrf-parser) | Read a Switchboard VRF account and make a Cross Program Invocation (CPI) to request a new randomness value |
| Anchor | [anchor-vrf-lite-parser](programs/anchor-vrf-lite-parser) | Read a Switchboard VRF Lite account and make a Cross Program Invocation (CPI) to request a new randomness value |
| Anchor | [anchor-buffer-parser](programs/anchor-buffer-parser) | Read a Switchboard buffer relayer using Anchor |
| Javascript | [javascript-feed-walkthrough](javascript/feed-walkthrough) | Create a private Switchboard queue and oracle and fulfill your own oracle updates |## Troubleshooting
1. File a
[GitHub Issue](https://github.com/switchboard-xyz/sbv2-solana/issues/new)
2. Ask a question in
[Discord #dev-support](https://discord.com/channels/841525135311634443/984343400377647144)