# IKyberHintHandler

{% hint style="warning" %}
You are referring to the **`Legacy`** version of KyberSwap docs.

For the most updated information, please refer to:

* [**`Classic`**](https://github.com/KyberNetwork/kyberswap-documentation/blob/main/reference/legacy/api-abi/core-smart-contracts/broken-reference/README.md)
* [**`Elastic`**](https://docs.kyberswap.com/reference/legacy/kyberswap-elastic)
* [**`Limit Order`**](https://docs.kyberswap.com/kyberswap-solutions/limit-order)
* [**`Aggregator`**](https://docs.kyberswap.com/kyberswap-solutions/kyberswap-aggregator)
  {% endhint %}

## contract KyberHintHandler

is [IKyberHint](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikyberhint.md), Utils5\ imports Utils5, [IKyberHint](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-ikyberhint.md)

*Source*: [KyberHintHandler.sol](https://github.com/KyberNetwork/smart-contracts/blob/master/contracts/sol6/KyberHintHandler.sol)

***

### INDEX[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-kyberhinthandler#index) <a href="#index" id="index"></a>

\<AUTOGENERATED\_TABLE\_OF\_CONTENTS>

### REFERENCE[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-kyberhinthandler#reference) <a href="#reference" id="reference"></a>

#### Functions[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-kyberhinthandler#functions) <a href="#functions" id="functions"></a>

#### `parseTokenToEthHint`[​](https://docs.kyberswap.com/Legacy/api-abi/core-smart-contracts/api_abi-kyberhinthandler#parsetokentoethhint) <a href="#parsetokentoethhint" id="parsetokentoethhint"></a>

Parses the hint for a token -> eth trade.

***

function **parseTokenToEthHint**(IERC20 tokenSrc, bytes hint) public view override returns (TradeType tokenToEthType, bytes32\[] tokenToEthReserveIds, IKyberReserve\[] tokenToEthAddresses, uint256\[] tokenToEthSplits) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `tokenSrc` | IERC20 | source token to trade | | `hint` | bytes | the ABI encoded hint, built using the build hint functions |

**Returns:**\ tokenToEthType - decoded hint type tokenToEthReserveIds - decoded reserve IDs tokenToEthAddresses - reserve addresses corresponding to reserve IDs tokenToEthSplits - decoded splits

\
\### \`parseEthToTokenHint\` Parses the hint for a eth -> token trade. \_\_\_ function \_\_parseEthToTokenHint\_\_(IERC20 tokenDest, bytes hint) public view override returns (TradeType ethToTokenType, bytes32\[] ethToTokenReserveIds, IKyberReserve\[] ethToTokenAddresses, uint256\[] ethToTokenSplits) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`tokenDest\` | IERC20 | dest token to trade | | \`hint\` | bytes | the ABI encoded hint, built using the build hint functions |

**Returns:**\ ethToTokenType - decoded hint type ethToTokenReserveIds - decoded reserve IDs ethToTokenAddresses - reserve addresses corresponding to reserve IDs ethToTokenSplits - decoded splits

\
\### \`parseTokenToTokenHint\` Parses the hint for a token to token trade. \_\_\_ function \_\_parseTokenToTokenHint\_\_(IERC20 tokenSrc, IERC20 tokenDest, bytes hint) public view override returns (TradeType tokenToEthType, bytes32\[] tokenToEthReserveIds, IKyberReserve\[] tokenToEthAddresses, uint256\[] tokenToEthSplits, TradeType ethToTokenType, bytes32\[] ethToTokenReserveIds, IKyberReserve\[] ethToTokenAddresses, uint256\[] ethToTokenSplits) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`tokenSrc\` | IERC20 | source token to trade | | \`tokenDest\` | IERC20 | dest token to trade | | \`hint\` | bytes | the ABI encoded hint, built using the build hint functions | \*\*Returns:\*\*\ tokenToEthType - decoded hint type tokenToEthReserveIds - decoded reserve IDs tokenToEthAddresses - reserve addresses corresponding to reserve IDs tokenToEthSplits - decoded splits ethToTokenType - decoded hint type ethToTokenReserveIds - decoded reserve IDs ethToTokenAddresses - reserve addresses corresponding to reserve IDs ethToTokenSplits - decoded splits\
\### \`buildTokenToEthHint\` Builds the hint for a token -> eth trade. \_\_\_ function \_\_buildTokenToEthHint\_\_(IERC20 tokenSrc, TradeType tokenToEthType, bytes32\[] tokenToEthReserveIds, uint256\[] tokenToEthSplits) public view override returns (bytes hint) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`tokenSrc\` | IERC20 | source token to trade | | \`tokenToEthType\` | TradeType | token -> eth trade hint type | | \`tokenToEthReserveIds\` | bytes32\[] | token -> eth reserve IDs | | \`tokenToEthSplits\` | uint256\[] | token -> eth reserve splits | \*\*Returns:\*\*\ hint - the ABI encoded hint\
\### \`buildEthToTokenHint\` Builds the hint for a eth -> token trade. \_\_\_ function \_\_buildEthToTokenHint\_\_(IERC20 tokenDest, TradeType ethToTokenType, bytes32\[] ethToTokenReserveIds, uint256\[] ethToTokenSplits) public view override returns (bytes hint) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`tokenDest\` | IERC20 | destination token to trade | | \`ethToTokenType\` | TradeType | eth -> token trade hint type | | \`ethToTokenReserveIds\` | bytes32\[] | eth -> token reserve IDs | | \`ethToTokenSplits\` | uint256\[] | eth -> token reserve splits | \*\*Returns:\*\*\ hint - the ABI encoded hint\
\### \`buildTokenToTokenHint\` Builds the hint for a token to token trade. \_\_\_ function \_\_buildTokenToTokenHint\_\_(IERC20 tokenSrc, TradeType tokenToEthType, bytes32\[] tokenToEthReserveIds, uint256\[] tokenToEthSplits, IERC20 tokenDest, TradeType ethToTokenType, bytes32\[] ethToTokenReserveIds, uint256\[] ethToTokenSplits) public view override returns (bytes hint) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | \`tokenSrc\` | IERC20 | source token to trade | | \`tokenToEthType\` | TradeType | token -> eth trade hint type | | \`tokenToEthReserveIds\` | bytes32\[] | token -> eth reserve IDs | | \`tokenToEthSplits\` | uint256\[] | token -> eth reserve splits | | \`tokenDest\` | IERC20 | destination token to trade | | \`ethToTokenType\` | TradeType | eth -> token trade hint type | | \`ethToTokenReserveIds\` | bytes32\[] | eth -> token reserve IDs | | \`ethToTokenSplits\` | uint256\[] | eth -> token reserve splits |

**Returns:**\ hint - the ABI encoded hint


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kyberswap.com/reference/legacy/api-abi/core-smart-contracts/ikyberhinthandler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
