mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Fixed poolOnly
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@orionprotocol/sdk",
|
"name": "@orionprotocol/sdk",
|
||||||
"version": "0.14.0-rc.0",
|
"version": "0.14.0-rc.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",
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export default async function getSwapMarketFeeInfo({
|
|||||||
assetOut,
|
assetOut,
|
||||||
amount.toString(),
|
amount.toString(),
|
||||||
false,
|
false,
|
||||||
options?.poolOnly ? ['ORION_POOL'] : undefined,
|
options?.poolOnly ? 'pools' : undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (swapInfo.orderInfo !== null && options?.poolOnly === true && options.poolOnly !== swapInfo.isThroughPoolOptimal) {
|
if (swapInfo.orderInfo !== null && options?.poolOnly === true && options.poolOnly !== swapInfo.isThroughPoolOptimal) {
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ class OrionAggregator {
|
|||||||
assetOut: string,
|
assetOut: string,
|
||||||
amount: string,
|
amount: string,
|
||||||
instantSettlement?: boolean,
|
instantSettlement?: boolean,
|
||||||
exchanges?: Exchange[],
|
exchanges?: Exchange[] | 'cex' | 'pools',
|
||||||
) => {
|
) => {
|
||||||
const url = new URL(`${this.apiUrl}/api/v1/swap`);
|
const url = new URL(`${this.apiUrl}/api/v1/swap`);
|
||||||
url.searchParams.append('assetIn', assetIn);
|
url.searchParams.append('assetIn', assetIn);
|
||||||
@@ -163,9 +163,13 @@ class OrionAggregator {
|
|||||||
url.searchParams.append('amountOut', amount);
|
url.searchParams.append('amountOut', amount);
|
||||||
}
|
}
|
||||||
if (exchanges) {
|
if (exchanges) {
|
||||||
exchanges.forEach((exchange) => {
|
if (Array.isArray(exchanges)) {
|
||||||
url.searchParams.append('exchanges', exchange);
|
exchanges.forEach((exchange) => {
|
||||||
});
|
url.searchParams.append('exchanges', exchange);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
url.searchParams.append('exchanges', exchanges);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (instantSettlement) {
|
if (instantSettlement) {
|
||||||
url.searchParams.append('instantSettlement', 'true');
|
url.searchParams.append('instantSettlement', 'true');
|
||||||
|
|||||||
Reference in New Issue
Block a user