개요
유니스왑 V2 토큰 스왑 서비스를 제공합니다.
코인 및 토큰 별 [유동성 공급 풀] 제공 서비스 범위 안에서 메인넷 코인, ERC-20 토큰 간의 자동 교환 거래가 가능합니다.
유니스왑 : https://uniswap.org/
유니스왑 유동성 공급 풀 : https://app.uniswap.org/
Parameters
if token -> coin,
if token ->token
required
if coin ->token ,
if token -> token
required
Response
호출 결과 성공여부 (성공: OK, 실패: FAIL)
value (array of object)
Example
// parameters
val network = "polygon"
val from = "0x..."
val from_token_id = "0x..."
val to_token_id = "0x..."
val amount = "100000"
// Coin -> Token
val coinForTokenswap = coinForTokenswapAsync(network,
from,
to_token_id,
amount)
// Token -> Token
val tokenForTokenswap = tokenForTokenswapAsync(network,
from,
from_token_id,
to_token_id,
amount)
// Token -> Coin
val tokenForCoinswap = tokenForCoinswapAsync(network,
from,
from_token_id,
amount)
println(coinForTokenswap)
println(tokenForTokenswap)
println(tokenForCoinswap)
// result log
/*
{
"result": "OK",
"value":[
{
"transactionHash" : "0x..."
}
]
}
*/
Parameters
if coin ->token ,
if token -> token
required
if token -> coin,
if token ->token
required
Response
호출 결과 성공여부 (성공: OK, 실패: FAIL)
value (array of object)
Example
// parameters
let network = "ethereum"
let from = "0x..."
let to_token_id = "0x..."
let from_token_id = "0x..."
let amount = "100000"
// Coin -> Token
let coinForTokenswap = try await coinForTokenswapAsync(network: network,
from: from,
to_token_id: to_token_id,
amount: amount)
// Token -> Token
let tokenForTokenswap = try await tokenForTokenswapAsync(network : network,
from: from,
to_token_id: to_token_id,
from_token_id: from_token_id,
amount: amount)
// Token -> Coin
let tokenForCoinswap = try await tokenForCoinswapAsync(network: network,
from: from,
from_token_id: from_token_id,
amount: amount)
print(coinForTokenswap)
print(tokenForTokenswap)
print(tokenForCoinswap)
// result log
/*
{
"result": "OK",
"value":[
{
"transactionHash" : "0x..."
}
]
}
*/