mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-18 03:45:02 +03:00
15 lines
359 B
TypeScript
15 lines
359 B
TypeScript
export default function getSwapSide(
|
|
assetIn: string | null | undefined,
|
|
assetOut: string | null | undefined,
|
|
type: 'exactSpend' | 'exactReceive',
|
|
) {
|
|
if (!assetIn || !assetOut) {
|
|
return undefined;
|
|
}
|
|
|
|
if (assetOut === 'USDT') return 'SELL';
|
|
if (assetIn === 'USDT') return 'BUY';
|
|
if (type === 'exactSpend') return 'SELL';
|
|
return 'BUY';
|
|
}
|