add get atomic fee method

This commit is contained in:
TheJuze
2024-06-17 14:58:59 +03:00
parent f515d880f1
commit 5dce6e520d
3 changed files with 15 additions and 3 deletions

View File

@@ -71,6 +71,7 @@ class Aggregator {
this.getTradeProfits = this.getTradeProfits.bind(this);
this.getStableCoins = this.getStableCoins.bind(this);
this.placeAtomicSwap = this.placeAtomicSwap.bind(this);
this.getAtomicSwapFee = this.getAtomicSwapFee.bind(this);
this.placeOrder = this.placeOrder.bind(this);
this.placeLockOrder = this.placeLockOrder.bind(this);
this.cancelOrder = this.cancelOrder.bind(this);
@@ -444,6 +445,17 @@ class Aggregator {
errorSchema,
);
/**
* Get atomic swap fee in current chain
* @returns Fee in percents
*/
getAtomicSwapFee = () => fetchWithValidation(
`${this.apiUrl}/api/v1/atomic/swap-fee`,
z.string(),
{ headers: this.basicAuthHeaders },
errorSchema,
);
/**
* Get placed atomic swaps. Each atomic swap received from this list has a target chain corresponding to this Aggregator
* @param sender Sender address