Project Setup
First, let’s create a new project directory and initialize it with npm.package.json file.
TypeScript Configuration
Next, let’s install TypeScript and initialize atsconfig.json file.
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.
