mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-16 16:21:32 +03:00
move atomic fee method to blockchain service
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -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": {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()),
|
||||
|
||||
Reference in New Issue
Block a user