Giter VIP home page Giter VIP logo

evm-sdk's Introduction

Switchboard Logo

Switchboard x EVM

A collection of libraries and examples for interacting with Switchboard on EVM chains.

NPM Badge

Getting Started

To get started, clone the evm-sdk repository.

git clone https://github.com/switchboard-xyz/evm-sdk

Then install the dependencies

cd evm-sdk
pnpm install
pnpm build

Switchboard Functions

Switchboard V3 revolves around the concept of a Switchboard Function. Functions are the core building block of Switchboard. They are the unit of work that is performed by the Switchboard network. Functions can be user defined, and can be composed together to create more complex functions. Function calls can be initialized on-chain, or on a schedule.

Get started writing Switchboard Functions with our functions template repository.

Switchboard Feeds

Switchboard Data Feeds are powered by Switchboard Functions. You can find the source code (contracts and off-chain logic) for the Switchboard Function that powers the available feeds in the functions repository.

  • Receiver.sol) - The main entry point for the Switchboard Feed Function. This contract is deployed by the Switchboard, and is responsible for receiving data from the off-chain Switchboard Function, and making it available to other contracts.
  • Main.rs - The off-chain Switchboard Function that powers the Switchboard Feed. This function is responsible for fetching data from an external API, and submitting it to the Switchboard Receiver contract.

You can find existing Switchboard Feeds and their ID's for accessing in solidity at app.switchboard.xyz.

You can use this simple price function (which supplies 500+ feeds from top exchanges!) and build custom functionality on top of it

Clients

Lang Name Description
Solidity ISwitchboard A Solidity contract to read a Switchboard data feed.
Solidity ILegacyOracle A Solidity contract to read a Switchboard data feed with a legacy oracle adapter.
Javascript @switchboard-xyz/evm.js A Typescript client to interact with Switchboard on EVM chains.

Example Contracts

Lang Name Description
Solidity randomness-calllback An example Solidity contract demonstrating how to consume randomenss with Switchboard.
Solidity user-triggered-callback An example Solidity contract demonstrating how manually trigger a callback with Switchboard.

Troubleshooting

  1. File a GitHub Issue
  2. Ask a question in Discord #dev-support

evm-sdk's People

Contributors

gallynaut avatar ahermida avatar jessupjn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.