Skip to main content
This guide will walk you through setting up a new TypeScript project to interact with the Saros AMM SDK.

Project Setup

First, let’s create a new project directory and initialize it with npm.
This will create a package.json file.

TypeScript Configuration

Next, let’s install TypeScript and initialize a tsconfig.json file.
Now, replace the contents of the generated tsconfig.json with the following configuration. This sets up the project to work correctly with the Saros SDK, which is written in JavaScript. Key settings to note are "allowJs": true and "esModuleInterop": true to ensure compatibility, and "outDir": "./dist" to keep our compiled files organized.
tsconfig.json

Update package.json

To use ES modules, which is the standard for modern JavaScript, you need to add "type": "module" to your package.json. Here’s how the package.json should look after the change.
package.json

Install Saros SDK

Finally, install the @saros-finance/sdk. You can use either npm or yarn.
Now you are all set up to start building with the Saros AMM SDK!