SDK
Overview
The SDK is ideal for integrating cross-chain swaps, bridges, and deposits into applications that utilize JavaScript or Typescript, while the API can be used for similar purposes in a more language-agnostic manner.
Types
We recommend using the types from our npm package. If you are using our API without our SDK, you can find the types inside node_modules/@0xsquid/sdk/dist/types/index.d.ts
after Installing our SDK
import { Token, ChainData } from '@0xsquid/sdk/dist/types'
Installing the SDK
From the terminal, install our SDK
npm install --save @0xsquid/[email protected] # or higher
Now in your typescript file
import { Squid } from "@0xsquid/sdk"; // Import Squid SDK
// Initialize the Squid client with the base URL and integrator ID
const getSDK = (): Squid => {
const squid = new Squid({
baseUrl: "https://apiplus.squidrouter.com",
integratorId: integratorId,
});
return squid;
};
Next, explore the first Swap & Bridging with the Squid SDK to understand the fundamentals.
Last updated