Skip to content

Commit 9dbfbd8

Browse files
fix: update solve api example (#175)
update of solve api payload example with username and pw given changes to api yaml
1 parent f3f9e34 commit 9dbfbd8

File tree

3 files changed

+19
-25
lines changed

3 files changed

+19
-25
lines changed

docs/docs/03-Solve/02-solve-quick-start.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,22 @@ Calling the [**Get Route API**](solve-get-route-v1) returns the finalized route,
4545
- **Base:** `https://swaps.sprinter.tech/base`
4646

4747
```ts title="Example Fetch Quote Request Payload"
48-
const AMOUNT_IN; // the amount of token that you want exchange in their decimals denomination
49-
const TOKEN_IN_ADDRESS; // token_in_address
50-
const TOKEN_OUT_ADDRESS; // token_out_addres - tokens that you want to receieve
51-
const SLIPPAGE; // the slipapge that you want to allow for the swap ( 0.5 - 2%)
52-
const TARGET_DURATION;
48+
const AMOUNT_IN = "100000000"; // the amount of token you want to exchange, in its smallest unit (as a string)
49+
const TOKEN_IN_ADDRESS = "0x..."; // address of the token you want to sell
50+
const TOKEN_OUT_ADDRESS = "0x..."; // address of the token you want to buy
51+
const SLIPPAGE_BPS = 50; // slippage in basis points (e.g., 50 = 0.5%)
52+
const API_USER = "your_api_user";
53+
const API_PASS = "your_api_pass";
5354

5455
const fetchRoute = async () => {
55-
const response = await fetch(
56-
"https://swaps.sprinter.tech/mainnet/v2/route?amount_in=[AMOUNT_IN]&token_in=[TOKEN_IN_ADDRESS]&token_out=[TOKEN_OUT_ADDRESS]&slippage=[SLIPPAGE]&target_duration_ms=[TARGET_DURATION]",
57-
{
58-
method: "GET",
59-
headers: {
60-
"X-API-Key": "your_api_key_here",
61-
},
56+
const url = `https://swaps.sprinter.tech/mainnet/v1/route?amountIn=${AMOUNT_IN}&tokenIn=${TOKEN_IN_ADDRESS}&tokenOut=${TOKEN_OUT_ADDRESS}&slippageBps=${SLIPPAGE_BPS}`;
57+
58+
const response = await fetch(url, {
59+
method: "GET",
60+
headers: {
61+
Authorization: "Basic " + btoa(`${API_USER}:${API_PASS}`),
6262
},
63-
);
63+
});
6464

6565
const data = await response.json();
6666
return data;

packages/react/CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@
22

33
## [1.4.3](https://github.com/sprintertech/sprinter-sdk/compare/sprinter-react-v1.4.2...sprinter-react-v1.4.3) (2025-05-28)
44

5-
65
### Bug Fixes
76

8-
* **docs:** adding router addresses ([#163](https://github.com/sprintertech/sprinter-sdk/issues/163)) ([ff7f939](https://github.com/sprintertech/sprinter-sdk/commit/ff7f939bf87b6730fb5cdf409f1541c2c4aa95b7))
7+
- **docs:** adding router addresses ([#163](https://github.com/sprintertech/sprinter-sdk/issues/163)) ([ff7f939](https://github.com/sprintertech/sprinter-sdk/commit/ff7f939bf87b6730fb5cdf409f1541c2c4aa95b7))
98

109
## [1.4.2](https://github.com/sprintertech/sprinter-sdk/compare/sprinter-react-v1.4.1...sprinter-react-v1.4.2) (2025-05-27)
1110

12-
1311
### Bug Fixes
1412

15-
* **docs:** typos ([#161](https://github.com/sprintertech/sprinter-sdk/issues/161)) ([9f5c2f0](https://github.com/sprintertech/sprinter-sdk/commit/9f5c2f09d873bff398fa350d91f36829c9ba6220))
13+
- **docs:** typos ([#161](https://github.com/sprintertech/sprinter-sdk/issues/161)) ([9f5c2f0](https://github.com/sprintertech/sprinter-sdk/commit/9f5c2f09d873bff398fa350d91f36829c9ba6220))
1614

1715
## [1.4.1](https://github.com/sprintertech/sprinter-sdk/compare/sprinter-react-v1.4.0...sprinter-react-v1.4.1) (2025-05-21)
1816

19-
2017
### Bug Fixes
2118

22-
* added MPC details ([#159](https://github.com/sprintertech/sprinter-sdk/issues/159)) ([16fc0a2](https://github.com/sprintertech/sprinter-sdk/commit/16fc0a28ff7925c2643a313d572773d10f1b4619))
19+
- added MPC details ([#159](https://github.com/sprintertech/sprinter-sdk/issues/159)) ([16fc0a2](https://github.com/sprintertech/sprinter-sdk/commit/16fc0a28ff7925c2643a313d572773d10f1b4619))
2320

2421
## [1.4.0](https://github.com/sprintertech/sprinter-sdk/compare/sprinter-react-v1.3.0...sprinter-react-v1.4.0) (2025-05-09)
2522

packages/sdk/CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@
22

33
## [1.4.3](https://github.com/sprintertech/sprinter-sdk/compare/sprinter-sdk-v1.4.2...sprinter-sdk-v1.4.3) (2025-05-28)
44

5-
65
### Bug Fixes
76

8-
* **docs:** adding router addresses ([#163](https://github.com/sprintertech/sprinter-sdk/issues/163)) ([ff7f939](https://github.com/sprintertech/sprinter-sdk/commit/ff7f939bf87b6730fb5cdf409f1541c2c4aa95b7))
7+
- **docs:** adding router addresses ([#163](https://github.com/sprintertech/sprinter-sdk/issues/163)) ([ff7f939](https://github.com/sprintertech/sprinter-sdk/commit/ff7f939bf87b6730fb5cdf409f1541c2c4aa95b7))
98

109
## [1.4.2](https://github.com/sprintertech/sprinter-sdk/compare/sprinter-sdk-v1.4.1...sprinter-sdk-v1.4.2) (2025-05-27)
1110

12-
1311
### Bug Fixes
1412

15-
* **docs:** typos ([#161](https://github.com/sprintertech/sprinter-sdk/issues/161)) ([9f5c2f0](https://github.com/sprintertech/sprinter-sdk/commit/9f5c2f09d873bff398fa350d91f36829c9ba6220))
13+
- **docs:** typos ([#161](https://github.com/sprintertech/sprinter-sdk/issues/161)) ([9f5c2f0](https://github.com/sprintertech/sprinter-sdk/commit/9f5c2f09d873bff398fa350d91f36829c9ba6220))
1614

1715
## [1.4.1](https://github.com/sprintertech/sprinter-sdk/compare/sprinter-sdk-v1.4.0...sprinter-sdk-v1.4.1) (2025-05-21)
1816

19-
2017
### Bug Fixes
2118

22-
* added MPC details ([#159](https://github.com/sprintertech/sprinter-sdk/issues/159)) ([16fc0a2](https://github.com/sprintertech/sprinter-sdk/commit/16fc0a28ff7925c2643a313d572773d10f1b4619))
19+
- added MPC details ([#159](https://github.com/sprintertech/sprinter-sdk/issues/159)) ([16fc0a2](https://github.com/sprintertech/sprinter-sdk/commit/16fc0a28ff7925c2643a313d572773d10f1b4619))
2320

2421
## [1.4.0](https://github.com/sprintertech/sprinter-sdk/compare/sprinter-sdk-v1.3.0...sprinter-sdk-v1.4.0) (2025-05-09)
2522

0 commit comments

Comments
 (0)