API

Overview

Squid API is for devs using a client other than javascript. The API offers nearly the full functionality of the SDK, and is only missing some helper functions for front end work.

Below is the most basic example of building with Squid, a cross-chain swap. In this example, we will cover the key concepts involved in the swap.

To find all examples, please visit our examples repo.

Getting Started: Cross-chain Swaps

This example walks through the index.js code included in the EVMtoEVM API swap example.

Once you download the example folder evmToEVMSwap use the yarn install to install the necessary packages and create a .env file modeled based off the .env.example folder.

The following actions take place in the index.js:

  • Loading necessary packages and environmental variables

  • Defining route parameters, RPC provider, and wallet signer

  • Creating the route request and the transaction status functions

  • Defining the route parameters and requesting the route

  • Executing the route transactions

  • Checking the status of the transactions

Last updated