Icon
Contract API endpoints
Please refer to the smart contract documentation for ICON for instructions on how to use these API endpoints with their smart contracts.
ICON CONTRACT API
Call API
Method name | Param | Return | Description | Trade related |
| - | int | get the curent pool state | Yes |
| - | int | get max amount per transaction | Yes |
| int | int | Returns the amount of trading token to receive | Yes |
| int | int | Returns the amount of base token to receive | Yes |
| address | int | Return amount of UP token the user can claim | No |
| - | int | %Max amount per trade | Yes |
| - | int | If the pair is open for trading:[0 - close , 1 - open] | Yes |
| - | uint256 | Rebates %[Out of 100000] | Yes |
| - | int | %FEE for the pair[Out of 100000] | Yes |
| - | int | Return Total Supply of liquidity token | No |
| address | int | Return user liquidity balance | No |
| address | int | Return user ICX deposited into contract to add liquidity | No |
| - | string | Return Liquidity name Symbol | No |
| - | string | Return Liquidity Token Symbol | No |
| - | int | Return Liquidity Token Decimals | No |
Write API
Method name | Param | Return | Payable | Description | |
| address | int | Yes | When a user buys a trading token.Example UP/ICX, a user would like to BUY UP using 1 ICX param would be user account address, call value would be 1 ICX | |
| int | - | Yes | Deposit ICX in order to add liquidity | |
| - | - | No | Contract will return users all of ICX user credit | |
| int | - | No | Liquidity providers to withdraw their liquidity | |
| - | int | - | No | Liquidity providers to claim the UP fees earn from the smart contract |
Transfer trading token through token fall back function.Pack bytes in _data field.
_data | Method name | Purpose | Param | Return | Payable | Description |
b'1' |
|
| int | - | - | When a user sells a trading token.Example UP/ICX, a user would like to SELL 10 UP.The webapp *must( send an approval before executing sell function. Param would be 1e19[Up has 18 decimals we are selling 10 UP] |
b'4' |
|
| int | - | - | For Liquidity Providers to deposit their tokens approval/allowance must be given before trigerring this function |
Last updated