{% hint style="warning" %}
You are referring to the Legacy
version of KyberSwap docs.
For the most updated information, please refer to:
Classic
Elastic
Limit Order
Aggregator
{% endhint %}
imports IKyberNetworkProxy, IKyberReserve
Source: IKyberStorage.sol
INDEX
<AUTOGENERATED_TABLE_OF_CONTENTS>
REFERENCE
Functions
getReserveId
Returns the reserveID of the reserve given the address.
function getReserveId(address reserve) external view returns (bytes32 reserveId) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | reserve
| address | reserve address | Returns:\ reserveId - 32-byte reserve ID
### `getReserveIdsFromAddresses` Returns a list of reserveIDs from a list of given addresses. ___ function __getReserveIdsFromAddresses__(address[] reserveAddresses) external view returns (bytes32[] reserveIds) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserveAddresses` | address[] | list of reserve addresses | **Returns:**\ reserveIds - array of 32-byte reserve IDs
### `getReserveAddressesFromIds` Returns a list of addresses from a list of given reserve IDs. ___ function __getReserveAddressesFromIds__(bytes32[] reserveIds) external view returns (address[] reserveAddresses) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserveIds` | bytes32[] | list of reserve IDs | **Returns:**\ reserveAddresses - array of reserve addresses
### `getReserveIdsPerTokenSrc` Returns a list of reserve IDs that supports a given source token. ___ function __getReserveIdsPerTokenSrc__(IERC20 token) external view returns (bytes32[] reserveIds) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `token` | IERC20 | source token | **Returns:**\ reserveIds - array of 32-byte reserve IDs
### `getReserveAddressesPerTokenSrc` Returns a list of reserve addresses that supports a given source token. ___ function __getReserveAddressesPerTokenSrc__(IERC20 token, uint256 startIndex, uint256 endIndex) external view returns (address[] reserveAddresses) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `token` | IERC20 | source token | | `startIndex` | uint256 | start index of reserve list to narrow search | | `endIndex` | uint256 | end index of reserve list to narrow search | **Returns:**\ reserveAddresses - array of reserve addresses
### `getReserveIdsPerTokenDest` Returns a list of reserve IDs that supports a given destination token. ___ function __getReserveIdsPerTokenDest__(IERC20 token) external view returns (bytes32[] reserveIds) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `token` | IERC20 | destination token | **Returns:**\ reserveIds - array of 32-byte reserve IDs
### `getReserveAddressesByReserveId` Returns a list of addresses from a given reserve ID, where index 0 is the currently used reserve address and indexes > 0 are older versions. ___ function __getReserveAddressesByReserveId__(bytes32 reserveId) external view returns (address[] reserveAddresses) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserveId` | bytes32 | reserve ID of the reserve | **Returns:**\ reserveAddresses - array of reserve addresses
### `getRebateWalletsFromIds` Returns a list of rebates wallets from a list of given reserve IDs. ___ function __getRebateWalletsFromIds__(bytes32[] reserveIds) external view returns (address[] rebateWallets) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserveIds` | bytes32[] | list of reserve IDs | **Returns:**\ rebateWallets - array of rebate wallets addresses
### `getKyberProxies` Returns the list of KyberNetworkProxy addresses. ___ function __getKyberProxies__() external view returns (IKyberNetworkProxy[])\ **Returns:**\ Array of KyberNetworkProxy addresses
### `getReserveDetailsByAddress` Returns a reserve's information given a address. ___ function __getReserveDetailsByAddress__(address reserve) external view returns (bytes32 reserveId, address rebateWallet, ReserveType resType, bool isFeeAccountedFlag, bool isEntitledRebateFlag) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserve` | address | address of reserve | **Returns:**\ reserveId - reserve ID of the reserve rebateWallet - rebate wallet address of the reserve resType - the reserve type, where 0 - none, 1 - FPR, 2 - APR, 3 - Bridge, 4 - Utility, 5 - Custom, 6 - Orderbook, 7 - Last isFeeAccountedFlag - whether fees are to be charged for a trade for this reserve isEntitledRebateFlag - whether reserve is entitled to receive rebates
### `getReserveDetailsById` Returns a reserve's information given a reserve ID. ___ function __getReserveDetailsById__(bytes32 reserveId) external view returns (address reserveAddress, address rebateWallet, ReserveType resType, bool isFeeAccountedFlag, bool isEntitledRebateFlag) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserveId` | bytes32 | reserve ID of the reserve | **Returns:**\ reserveAddress - address of the reserve rebateWallet - rebate wallet address of the reserve resType - the reserve type, where 0 - none, 1 - FPR, 2 - APR, 3 - Bridge, 4 - Utility, 5 - Custom, 6 - Orderbook, 7 - Last isFeeAccountedFlag - whether fees are to be charged for a trade for this reserve isEntitledRebateFlag - whether reserve is entitled to receive rebates
### `getFeeAccountedData` Returns array of booleans if a respective reserve is fee accounted given a list of reserve IDs ___ function __getFeeAccountedData__(bytes32[] reserveIds) external view returns (bool[] feeAccountedArr) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserveIds` | bytes32[] | reserve ID of the reserve | **Returns:**\ feeAccountedArr - array of fee accounted booleans respective to reserve IDs input
### `getEntitledRebateData` Returns array of booleans if a respective reserve is entitled for rebates given a list of reserve IDs ___ function __getEntitledRebateData__(bytes32[] reserveIds) external view returns (bool[] entitledRebateArr) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserveIds` | bytes32[] | reserve ID of the reserve | **Returns:**\ entitledRebateArr - array of rebate entitled booleans respective to reserve IDs input
### `getReservesData` Returns information about fee, address, and rebate information of reserves given their reserve IDs. Also check if these reserve IDs are listed for token. ___ function __getReservesData__(bytes32[] reserveIds, IERC20 src, IERC20 dest) external view returns (bool areAllReservesListed, bool[] feeAccountedArr, bool[] entitledRebateArr, IKyberReserve[] reserveAddresses) | Parameter | Type | Description | | --------- |:-----:|:-----------:| | `reserveIds` | bytes32[] | list of reserve IDs | | `src` | IERC20 | source token | | `dest` | IERC20 | destination token | **Returns:**\ areAllReservesListed - if token is listed for the given reserve ID feeAccountedArr - array of fee accounted booleans respective to reserve IDs input entitledRebateArr - array of rebate entitled booleans respective to reserve IDs input reserveAddresses - array of reserve addresses
### `isKyberProxyAdded` Returns a boolean indicating if a KyberNetworkProxy has been added. ___ function __isKyberProxyAdded__() external view returns (bool)\ **Returns:**\ `true` if proxy has been added, otherwise `false`