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

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.23.0-rc2",
"version": "0.23.0-rc3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.23.0-rc2",
"version": "0.23.0-rc3",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.23.0-rc2",
"version": "0.23.0-rc3",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

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