Removed route param

This commit is contained in:
Aleksandr Kraiz
2022-05-22 23:51:09 +04:00
parent 9c3455e1b2
commit fee6c06780
2 changed files with 2 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.10.0",
"version": "0.10.1",
"description": "Orion Protocol SDK",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",

View File

@@ -22,7 +22,6 @@ export type SwapMarketParams = {
orionUnit: OrionUnit,
options?: {
logger?: (message: string) => void,
route?: 'pool' | 'aggregator',
autoApprove?: boolean,
}
}
@@ -50,7 +49,6 @@ export default async function swapMarket({
orionUnit,
options,
}: SwapMarketParams): Promise<Swap> {
if (options?.route) options?.logger?.('Warning! You specified route in options. Please use only if you know what you are doing.');
if (amount === '') throw new Error('Amount can not be empty');
if (assetIn === '') throw new Error('AssetIn can not be empty');
if (assetOut === '') throw new Error('AssetOut can not be empty');
@@ -127,9 +125,7 @@ export default async function swapMarket({
const percent = new BigNumber(slippagePercent).div(100);
const isThroughPoolOptimal = options?.route
? options?.route === 'pool'
: swapInfo.isThroughPoolOptimal;
const { isThroughPoolOptimal } = swapInfo;
if (isThroughPoolOptimal) {
options?.logger?.('Swap through pool');