synapsecns/sanguine

View on GitHub
packages/synapse-interface/utils/sortByPriorityRank.ts

Summary

Maintainability
A
0 mins
Test Coverage
import _ from 'lodash'

import { Token } from '@/utils/types'

export const sortByPriorityRank = (tokens: Token[]) => {
  return _.orderBy(
    tokens,
    [(token) => token.priorityRank, (token) => token.symbol.toLowerCase()],
    ['asc', 'asc']
  )
}