KTHULU DOCS
  • 소개
    • 크툴루 소개
    • 스캐너 소개
  • 크툴루 가이드
    • 이용 가이드
      • 다운로드 및 계정 생성
      • 컬렉션 및 NFT 조회
      • NFT 전송
      • 계정 활동
  • 크툴루 개발가이드
    • Quick Start
    • WEB, APP SDK 개발 가이드
      • 계정 생성
      • 계정 복원
      • 계정 정보 조회
      • 지갑 모드
      • 가스비 추정
      • 트랜잭션 상태 확인
      • 토큰 발행
      • 토큰 정보 조회
      • 토큰 목록 조회
      • 토큰 잔고 조회
      • 토큰 거래내역
      • 토큰 전송
      • 토큰 승인
      • 토큰 스왑
      • 토큰 브릿지
      • NFT 컬렉션 생성
      • NFT 민트 (발행)
      • NFT 다중민트 (발행)
      • NFT 조회
      • NFT 거래내역
      • NFT 총발행량
      • NFT 전송
      • NFT 다중전송
      • NFT 소각
      • NFT 숨김
      • NFT 숨김 조회
      • NFT 브릿지
      • NFT 스캠방지
    • Scanner APP SDK 개발 가이드
      • NFT 홀더인증(서명)
      • NFT 홀더인증(검증)
      • NFT 홀더인증(확인)
    • 블록체인 End-Point
      • Ethereum
      • Klaytn
      • Polygon
      • BNB
    • 블록체인 스캐너(Crawler) 로직
      • crawler_table
      • nft_collection_table
      • nft_owner_table
      • nft_token_table
      • nft_transaction_table
      • nft_hide_table
      • nodes_table
      • statistics_table
      • token_owner_table
      • token_table
      • token_transfer_table
      • users_table
      • Crawler Flow
  • 모니터링
    • 모니터링24
  • 고객센터
    • 문의 및 제안
  • 공지사항
    • 공지사항
      • Kthulu App
      • Live Scanner
      • Blockchain Node
    • 릴리즈 노트
  • 크툴루 약관
    • 개인정보처리방침
    • 서비스이용약관
  • 스캐너 약관
    • 개인정보처리방침
    • 서비스이용약관
  • 참조
    • 매뉴얼
      • Live Scanner 운영자 메뉴얼
    • SW사양서
      • Kthulu SDK
      • Live Scanner(Crawler)
Powered by GitBook
On this page
  1. 크툴루 개발가이드
  2. WEB, APP SDK 개발 가이드

토큰 스왑

Previous토큰 승인Next토큰 브릿지

Last updated 1 year ago

개요

유니스왑 V2 토큰 스왑 서비스를 제공합니다.

코인 및 토큰 별 [유동성 공급 풀] 제공 서비스 범위 안에서 메인넷 코인, 토큰 간의 자동 교환 거래가 가능합니다.

유니스왑 :

유니스왑 유동성 공급 풀 :

Parameters

이름
타입
설명
참조

network

String

네트워크

required

from

String

보낸 계정

required

from_token_id

String

보낸 토큰 아이디 (컨트랙트 주소)

if token -> coin,

if token ->token

required

to_token_id

String

받는 토큰 아이디 (컨트랙트 주소)

if coin ->token ,

if token -> token

required

amount

String

이동 수량

required

Response

이름
타입
설명

result

String

호출 결과 성공여부 (성공: OK, 실패: FAIL)

value (array of object)

이름
타입
설명

transactionHash

String

트랜잭션 Hash 값

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

이름
타입
설명
참조

network

String

네트워크

required

from

String

보낸 계정

required

to_token_id

String

받는 토큰 아이디 (컨트랙트 주소)

if coin ->token ,

if token -> token

required

from_token_id

String

보낸 토큰 아이디 (컨트랙트 주소)

if token -> coin,

if token ->token

required

amount

String

이동 수량

required

Response

이름
타입
설명

result

String

호출 결과 성공여부 (성공: OK, 실패: FAIL)

value (array of object)

이름
타입
설명

transactionHash

String

트랜잭션 Hash 값

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..."
            }
        ]
    }
*/

ERC-20
https://uniswap.org/
https://app.uniswap.org/