diff --git a/docs/docs/01-introduction/04-supported-networks.md b/docs/docs/01-introduction/04-supported-networks.md index 50d5481..bbdcf4d 100644 --- a/docs/docs/01-introduction/04-supported-networks.md +++ b/docs/docs/01-introduction/04-supported-networks.md @@ -19,6 +19,10 @@ New routes, networks, and tokens can readily be added by the Sprinter team. Plea ### Supported Networks and Tokens +:::note +Test networks and main networks have different API endpoints. Make sure to use the correct one based on your needs. +::: + :::tip Hover over network icon or token to show available routes ::: diff --git a/docs/docs/02-quick-start.md b/docs/docs/02-quick-start.md index 43175d7..29b6033 100644 --- a/docs/docs/02-quick-start.md +++ b/docs/docs/02-quick-start.md @@ -31,7 +31,7 @@ Here’s a quick example of how to use the SDK in your project: ```typescript import { Sprinter, Environment } from "@chainsafe/sprinter-sdk"; -const sprinter = new Sprinter({ baseUrl: Environment.MAINNET }); +const sprinter = new Sprinter({ baseUrl: Environment.TESTNET }); sprinter.getUserBalances("0xYourAddressHere").then(console.log); ``` @@ -74,7 +74,7 @@ function BalancesComponent() { function App() { return ( - + ); diff --git a/docs/docs/03-sdk/02-installation.md b/docs/docs/03-sdk/02-installation.md index 19dc3fc..66ebef3 100644 --- a/docs/docs/03-sdk/02-installation.md +++ b/docs/docs/03-sdk/02-installation.md @@ -27,12 +27,16 @@ npm install @chainsafe/sprinter-sdk Once the SDK is installed, you can initialize it to interact with blockchain networks and fetch data like user balances and supported tokens. +:::note +The `baseUrl` should be changed depending on whether you want to interract with test networks or main networks. +::: + ### Example: Initialize `Sprinter` ```typescript import { Sprinter, Environment } from "@chainsafe/sprinter-sdk"; -const sprinter = new Sprinter({ baseUrl: Environment.MAINNET }); +const sprinter = new Sprinter({ baseUrl: Environment.TESTNET }); const ownerAddress = "0xYourAddressHere"; sprinter.getUserBalances(ownerAddress).then(console.log); @@ -51,9 +55,9 @@ const tokenSymbol = "USDC"; api.getErc20Balances(ownerAddress, tokenSymbol).then(console.log); ``` -## Environment Configuration +## Base url Configuration -You can configure the SDK using environment variables to set the base URL for API requests. +The base url will define the url used for API requests. If you want to make calls to test networks (e.g Sepolia, BaseSepolia...) you should use the test endpoint available from the exported `Environment` Enum: `Environment.TESTNET`. For main networks you can use `Environment.MAINNET`. ### Example: Set Base URL diff --git a/docs/docs/03-sdk/03-configuration.md b/docs/docs/03-sdk/03-configuration.md index 88e5fb3..122a6fc 100644 --- a/docs/docs/03-sdk/03-configuration.md +++ b/docs/docs/03-sdk/03-configuration.md @@ -16,6 +16,10 @@ When initializing the `Sprinter` class, you can pass a `baseUrl` configuration o The `baseUrl` is the API server endpoint. You can either set it manually or use the predefined `Environment` enum to simplify configuration. +:::note +Test networks and main networks have different API endpoints. Make sure to use the correct one based on your needs. +::: + ```typescript import { Sprinter, Environment } from "@chainsafe/sprinter-sdk"; @@ -26,7 +30,7 @@ const sprinter = new Sprinter({ // Or using a predefined environment URL const sprinterWithEnv = new Sprinter({ - baseUrl: Environment.MAINNET, // Enum that provides predefined URLs + baseUrl: Environment.TESTNET, // Enum that provides predefined URLs, use `Environment.TESTNET` for mainnet }); ``` @@ -61,7 +65,8 @@ setBaseUrl(process.env.SPRINTER_URL); ## Available URLs -Here are the URLs you can use for the `baseUrl`: +Here are the URLs you can use for the `baseUrl`. +If you interract with test networks (e.g Sepolia, BaseSepolia...) use the Testnet url otherwise use the Mainnet one. - **Mainnet**: `https://api.sprinter.buildwithsygma.com/` - **Testnet**: `https://api.test.sprinter.buildwithsygma.com/` diff --git a/docs/docs/04-react-sdk/02-installation.md b/docs/docs/04-react-sdk/02-installation.md index a41ddd4..b3e086d 100644 --- a/docs/docs/04-react-sdk/02-installation.md +++ b/docs/docs/04-react-sdk/02-installation.md @@ -28,6 +28,10 @@ npm install react@latest react-dom@latest Once the installation is complete, wrap your app’s component tree with `SprinterContext` to provide access to Sprinter’s functionalities across your React components. +:::note +The `baseUrl` should be changed depending on whether you want to interract with test networks or main networks. E.g for Sepolia or BaseSepolia use `Environment.TESTNET`, otherwise use `Environment.MAINNET` +::: + ```tsx import React from "react"; import { SprinterContext } from "@chainsafe/sprinter-react"; @@ -42,7 +46,7 @@ function App() { } ``` -By passing the `baseUrl`, you specify which environment (testnet or mainnet) to use for API calls. +By passing the `baseUrl`, you specify which endpoint to use for API calls. If you interract with test networks (e.g Sepolia, BaseSepolia...) use the Testnet url otherwise use the Mainnet one. ### Available URLs: diff --git a/package.json b/package.json index 7c905aa..c5157f2 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "@types/eslint": "^8.56.11", "@types/node": "18.19.42", "eslint": "8.57.0", - "typescript": "^5.0.3", - "prettier": "^3.4.2" + "prettier": "^3.4.2", + "typescript": "^5.0.3" }, "volta": { "node": "20.17.0",