diff --git a/package-lock.json b/package-lock.json index e593e22..fd1b9af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@orionprotocol/sdk", - "version": "0.23.0-rc3", + "version": "0.23.0-rc4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@orionprotocol/sdk", - "version": "0.23.0-rc3", + "version": "0.23.0-rc4", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index ac36d1d..2e68f4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.23.0-rc3", + "version": "0.23.0-rc4", "description": "Orion Protocol SDK", "main": "./lib/index.cjs", "module": "./lib/index.js", diff --git a/src/services/Aggregator/index.ts b/src/services/Aggregator/index.ts index 76719d7..f1a0516 100644 --- a/src/services/Aggregator/index.ts +++ b/src/services/Aggregator/index.ts @@ -71,7 +71,6 @@ 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); @@ -445,17 +444,6 @@ 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 diff --git a/src/services/BlockchainService/index.ts b/src/services/BlockchainService/index.ts index ceacbcb..885a4f6 100644 --- a/src/services/BlockchainService/index.ts +++ b/src/services/BlockchainService/index.ts @@ -20,6 +20,7 @@ import { makePartial } from '../../utils'; import type { networkCodes } from '../../constants/index.js'; import { fetchWithValidation } from 'simple-typed-fetch'; import type { BasicAuthCredentials } from '../../types.js'; +import errorSchema from '../Aggregator/schemas/errorSchema'; type IAdminAuthHeaders = { auth: string @@ -115,6 +116,7 @@ class BlockchainService { this.claimOrder = this.claimOrder.bind(this); this.getGasLimits = this.getGasLimits.bind(this); this.getExchangeContractWalletBalance = this.getExchangeContractWalletBalance.bind(this); + this.getAtomicSwapFee = this.getAtomicSwapFee.bind(this); } get basicAuthHeaders() { @@ -491,6 +493,17 @@ class BlockchainService { }, ); + /** + * 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, + ); + getGasLimits = () => fetchWithValidation( `${this.apiUrl}/api/baseLimits`, z.record(z.number()),