Swap And Pool
Swap and Pool APIs support HTTP protocol. It uses point_ namespace.
swap_getPairList
Returns a Pool pair list.
Parameters
None
Return Value
Example
swap_getAmountOut
Returns an expected amountOut value for amountIn.
Parameters
Return Value
Example
swap_tokenToToken
Swap ERC20 token to ERC20 token. Before the call, swap_approve must be done for tokenIn by amountIn .
Parameters
In order to perform a transaction, the owner must have a balance of at least 2 GFEI for gas cost.
Return Value
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net_getTransactionStatus.
Example
swap_getLiquidityRate
Returns a liquidity rate of swap pool for token0 and token1.
Parameters
Return Value
Example
swap_getLiquidityBalance
Returns a liquidity balance of sender.
Parameters
Return Value
Example
swap_addLiquidity
Supply liquidity to token0 and token1 Swap Pool. Before the call, swap_approve must be done for tokenIn by amountIn and tokenOut by amountOut.
Parameters
In order to perform a transaction, the owner must have a balance of at least 2 GFEI for gas cost.
Return Value
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net_getTransactionStatus.
Example
swap_removeLiquidity
Remove liquidity from token0 and token1 Swap Pool. Before the call, swap_approveLiquidity must be done for token0 and token1.
Parameters
In order to perform a transaction, the owner must have a balance of at least 2 GFEI for gas cost.
Return Value
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net_getTransactionStatus.
Example
swap_approve
Approve Token from owner-address to Swap
Parameters
In order to perform a transaction, the from address must have a balance of at least 100 MFEI for gas cost.
Return Value
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net_getTransactionStatus.
Example
swap_getAllowance
Returns an allowed Token amount from owner address to to spender address.
Parameters
Return Value
Example
swap_approveLiquidity
Approve liquidity token from owner-address to Swap for remove liquidity.
Parameters
In order to perform a transaction, the from address must have a balance of at least 100 MFEI for gas cost.
Return Value
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using net_getTransactionStatus.
Example
swap_getAllowanceLiquidity
Returns an allowed liquidity token amount from owner address to to spender address.
Parameters
Return Value
Example
Last updated