IKyberHint
You are referring to the Legacy
version of KyberSwap docs.
For the most updated information, please refer to:
Classic
interface IKyberHint
imports IKyberReserve
Source: IKyberHint.sol
INDEX
<AUTOGENERATED_TABLE_OF_CONTENTS>
REFERENCE
Functions
buildTokenToEthHint
buildTokenToEthHint
Builds the hint for a token -> eth trade.
function buildTokenToEthHint(IERC20 tokenSrc, TradeType tokenToEthType, bytes32[] tokenToEthReserveIds, uint256[] tokenToEthSplits) external view 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) external view 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) external view 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
### `parseTokenToEthHint` Parses the hint for a token -> eth trade. ___ function __parseTokenToEthHint__(IERC20 tokenSrc, bytes hint) external view 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) external view 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) external view 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
Last updated