Fix: pools instead ORION_POOL

This commit is contained in:
Aleksandr Kraiz
2022-09-03 14:47:36 +04:00
parent dcbd07572d
commit ebed263f0b
5 changed files with 20 additions and 7 deletions

View File

@@ -274,8 +274,8 @@ const swapInfo = await simpleFetch(orionUnit.orionAggregator.getSwapInfo)(
"exactSpend", // type
"ORN", // asset in
"USDT", // asset out
25.23453457, // amount
["ORION_POOL"] // Exchanges. OPTIONAL! Specify ['ORION_POOL'] if you want "pool only" swap execution
25.23453457 // amount
// Exchanges. OPTIONAL! Specify 'pools' if you want "pool only" swap execution. Specify 'cex' if you want "cex only" execution
);
```

View File

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

View File

@@ -126,7 +126,7 @@ export default async function swapMarket({
assetOut,
amount.toString(),
options?.instantSettlement,
options?.poolOnly ? ['ORION_POOL'] : undefined,
options?.poolOnly ? 'pools' : undefined,
);
const { exchanges: swapExchanges } = swapInfo;

View File

@@ -0,0 +1,14 @@
export default [
// CEXes
'ASCENDEX',
'OKX',
'BINANCE',
'KUCOIN',
// DEXes
'SPOOKYSWAP',
'PANCAKESWAP',
'UNISWAP',
'QUICKSWAP',
'ORION_POOL',
] as const;

View File

@@ -1,4 +1,5 @@
import BigNumber from 'bignumber.js';
import exchanges from './constants/exchanges';
import orderStatuses from './constants/orderStatuses';
import subOrderStatuses from './constants/subOrderStatuses';
@@ -197,6 +198,4 @@ export type BalanceIssue = {
readonly fixes?: Fix[],
}
const availableExchanges = ['ORION_POOL', 'ASCENDEX', 'BINANCE', 'KUCOIN'] as const;
export type Exchange = typeof availableExchanges[number];
export type Exchange = typeof exchanges[number];