import { RouteInstructions, RouterInstructions } from './types'; import { Instruction } from '@solana/kit'; export function compileRouteIxs( ixs: RouterInstructions | RouteInstructions, skipWrapAndUnwrapSolIxs: boolean = false, ): Instruction[] { const { createInAtaIxs, createOutAtaIxs, wrapSolIxs, swapIxs, unwrapSolIxs, limoLogsStartIxs = [], limoLedgerStartIxs = [], limoLogsEndIxs = [], limoLedgerEndIxs = [], } = ixs as RouterInstructions; return [ ...createInAtaIxs, ...createOutAtaIxs, ...(skipWrapAndUnwrapSolIxs ? [] : wrapSolIxs), ...limoLogsStartIxs, ...limoLedgerStartIxs, ...swapIxs, ...limoLedgerEndIxs, ...limoLogsEndIxs, ...(skipWrapAndUnwrapSolIxs ? [] : unwrapSolIxs), ]; }