Skip to content

API ReferenceReact componentsFunction

sortTokenOptions()

function sortTokenOptions(tokens, mode, usdValues?): TokenOption[];

Beta

Sort token options according to TokenSortMode. Returns a new array; the input is not mutated. For 'usd' mode, callers must pass a usdValues map (address → USD cents); when omitted, USD mode degrades to alphabetical.

Parameters

ParameterType
tokensTokenOption[]
modeTokenSortMode
usdValues?Record<`0x${string}`, bigint | undefined>

Returns

TokenOption[]

Remarks

Part of the SDK’s experimental React component surface — may change or be removed without notice and is not part of the compatibility contract.