mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-22 21:59:44 +03:00
Removed route param
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.10.0",
|
"version": "0.10.1",
|
||||||
"description": "Orion Protocol SDK",
|
"description": "Orion Protocol SDK",
|
||||||
"main": "./lib/esm/index.js",
|
"main": "./lib/esm/index.js",
|
||||||
"module": "./lib/esm/index.js",
|
"module": "./lib/esm/index.js",
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export type SwapMarketParams = {
|
|||||||
orionUnit: OrionUnit,
|
orionUnit: OrionUnit,
|
||||||
options?: {
|
options?: {
|
||||||
logger?: (message: string) => void,
|
logger?: (message: string) => void,
|
||||||
route?: 'pool' | 'aggregator',
|
|
||||||
autoApprove?: boolean,
|
autoApprove?: boolean,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,7 +49,6 @@ export default async function swapMarket({
|
|||||||
orionUnit,
|
orionUnit,
|
||||||
options,
|
options,
|
||||||
}: SwapMarketParams): Promise<Swap> {
|
}: 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 (amount === '') throw new Error('Amount can not be empty');
|
||||||
if (assetIn === '') throw new Error('AssetIn can not be empty');
|
if (assetIn === '') throw new Error('AssetIn can not be empty');
|
||||||
if (assetOut === '') throw new Error('AssetOut 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 percent = new BigNumber(slippagePercent).div(100);
|
||||||
|
|
||||||
const isThroughPoolOptimal = options?.route
|
const { isThroughPoolOptimal } = swapInfo;
|
||||||
? options?.route === 'pool'
|
|
||||||
: swapInfo.isThroughPoolOptimal;
|
|
||||||
|
|
||||||
if (isThroughPoolOptimal) {
|
if (isThroughPoolOptimal) {
|
||||||
options?.logger?.('Swap through pool');
|
options?.logger?.('Swap through pool');
|
||||||
|
|||||||
Reference in New Issue
Block a user