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