Movement

Examples and Source Code

Source code for the Switchboard On-Demand Movement integration can be found in the github repo along with examples.

Active Deployments

The Switchboard On-Demand service is currently deployed on the following networks:

Adapter Addresses


Typescript-SDK Installation

To use Switchboard On-Demand, add the following dependencies to your project:

NPM

Bun

PNPM

Adding Switchboard to Move Code

To integrate Switchboard with Move, add the following dependencies to Move.toml:

Example Move Code for Using Switchboard Values

In the example.move module, use the Aggregator and CurrentResult types to access the latest feed data.

Once dependencies are configured, updated aggregators can be referenced easily.

This implementation allows you to read and utilize Switchboard data feeds within Move. If you have any questions or need further assistance, please contact the Switchboard team.

Creating an Aggregator and Sending Transactions

Building a feed in Switchboard can be done using the Typescript SDK, or it can be done with the Switchboard Web App. Visit our docs for more on designing and creating feeds.

Building Feeds in Typescript [optional]

Updating Feeds

(optional) Using On-Demand with V2 interface

If you have existing code using the Switchboard V2 interface, you can use the On-Demand adapter for full compatibility with the new On-Demand service.

1. Update Move.toml

You'll need to update your Move.toml to include the new switchboard adapter address. Pick the correct one for your target network.

2. Cranking

On-demand works on a pull-based mechanism, so you will have to crank feeds with your client-side code in order to get the latest data. This can be done using the Typescript SDK.

Last updated