Skip to content

Commit 4ab6ea9

Browse files
v0.24.0
1 parent b9d159d commit 4ab6ea9

File tree

6 files changed

+50
-1
lines changed

6 files changed

+50
-1
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Changelog
22

3+
## [0.24.0]
4+
5+
### Added
6+
7+
- `simulateSwap` method parameters were extended with new fields:
8+
- `poolAddress`
9+
10+
- `simulateReverseSwap` method parameters were extended with new fields:
11+
- `poolAddress`
12+
13+
- `SwapSimulationResponse` was extended with new fields:
14+
- `recommendedSlippageTolerance` Recommended difference between the original price of the order and the final price (considering potential sandwich attack)
15+
- `recommendedMinAskUnits` Recommended minimal amount of ask units (considering potential sandwich attack)
16+
- `swapRate`
17+
- `gasParams`
18+
- `gasBudget` Optional TON gas budget for transaction
19+
- `forwardGas` Forward TON amount for transaction
20+
- `estimatedGasConsumption` Estimated gas consumption
21+
22+
- `PoolInfoResponse` was extended with new fields:
23+
- `amp` Stable swap amplification parameter
24+
- `rate` Stable token ratio parameter
25+
- `w0` Token 0 weight parameter
26+
327
## [0.23.0]
428

529
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ston-fi/api",
3-
"version": "0.23.0",
3+
"version": "0.24.0",
44
"description": "Typescript client for Ston.fi Http API",
55
"license": "MIT",
66
"homepage": "https://github.com/ston-fi/api#readme",

src/client/apiClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,12 @@ export class StonApiClient {
307307
* @default undefined
308308
*/
309309
dexVersion?: Array<"1" | 1 | "2" | 2>;
310+
/**
311+
* Pool address
312+
*
313+
* @default undefined
314+
*/
315+
poolAddress?: string;
310316
}) {
311317
return normalizeResponse(
312318
await this.apiFetch<SwapSimulationResponse>(
@@ -365,6 +371,12 @@ export class StonApiClient {
365371
* @default undefined
366372
*/
367373
dexVersion?: Array<"1" | 1 | "2" | 2>;
374+
/**
375+
* Pool address
376+
*
377+
* @default undefined
378+
*/
379+
poolAddress?: string;
368380
}) {
369381
return normalizeResponse(
370382
await this.apiFetch<SwapSimulationResponse>(

src/client/types/gas.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export type GasParams = {
2+
gas_budget?: string;
3+
forward_gas: string;
4+
estimated_gas_consumption: string;
5+
};

src/client/types/pool.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ export type PoolInfoResponse = {
2424
token1_address: string;
2525
token1_balance?: string | null;
2626
volume_24h_usd?: string | null;
27+
amp?: string;
28+
rate?: string;
29+
w0?: string;
2730
};

src/client/types/swap.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { GasParams } from "./gas";
2+
13
export type SwapSimulationResponse = {
24
ask_address: string;
35
ask_jetton_wallet: string;
@@ -14,6 +16,9 @@ export type SwapSimulationResponse = {
1416
router_address: string;
1517
slippage_tolerance: string;
1618
swap_rate: string;
19+
recommended_slippage_tolerance: string;
20+
recommended_min_ask_units: string;
21+
gas_params: GasParams;
1722
};
1823

1924
export type SwapStatusResponse =

0 commit comments

Comments
 (0)