스왑 및 풀
스왑 및 풀 API는 HTTP 프로토콜을 지원합니다. point_ 네임스페이스를 사용합니다.
swap_getPairList
풀의 페어 목록을 반환합니다.
Parameters
없음
Return Value
Name | Type | Description |
---|---|---|
pairAddress | String | 페어 주소 |
token0 | String | 토큰 0의 주소 |
token1 | String | 토큰 1의 주소 |
symbol0 | String | 토큰 0의 심볼 |
symbol1 | String | 토큰 1의 심볼 |
amount0 | BigDecimal | 생성 당시 토큰 0의 유동성 비율 |
amount1 | BigDecimal | 생성 당시 토큰 1의 유동성 비율 |
Example
swap_getAmountOut
Token0의 입력금액에 대한 반환될 Token1의 예상 금액 값을 반환합니다.
Parameters
Name | Type | Description |
---|---|---|
amountIn | BigDecimal | 토큰 0의 금액 |
tokenIn | String | 입력토큰 |
tokenOut | String | 반환토큰 |
sender | String | 전송 주소 |
Return Value
Name | Type | Description |
---|---|---|
amountIn | BigDecimal | 토큰 입력 금액 |
amountOut | BigDecimal | 토큰 반환 금액 |
Example
swap_tokenToToken
ERC20 토큰을 ERC20 토큰으로 교환합니다. 호출하기 전에 amountIn에 의해 tokenIn에 대해 swap_approve가 수행되어야 합니다.
Parameters
Name | Type | Description |
---|---|---|
amountIn | BigDecimal | 입력 금액 |
tokenIn | String | 입력토큰주소 |
tokenOut | String | 반환토큰주소 |
sender | String | 전송주소 |
comment | String | 코멘트: 200자 제한 |
tempKey | String | tempKey for "swap" |
hashKey | String | hash(tempKey | secretKey) |
signature | String | sign( hash( amountIn | amountOut | tokenIn | sender | tempKey | hashKey ) ) by sender's privateKey using signData API |
거래를 수행하기 위해 소유자는 가스 비용에 대해 최소 2 GPEI의 잔액이 있어야 합니다.
Return Value
Name | Type | Description |
---|---|---|
transactionId | String | 트랜잭션 ID |
transactionId가 반환되지만 이것이 아직 블록에 추가되었다는 의미는 아닙니다. net_getTransactionStatus를 사용하여 상태가 1인지 확인해야 합니다.
Example
swap_getLiquidityRate
token0 및 token1에 대한 스왑 풀의 유동성 비율을 반환합니다.
Parameters
Name | Type | Description |
---|---|---|
token0 | String | 토큰 0의 주소 |
token1 | String | 토큰 1의 주소 |
sender | String | 전송주소 |
Return Value
Name | Type | Description |
---|---|---|
amount0 | BigDecimal | 토큰 0의 금액 |
amount1 | BigDecimal | 토큰 1의 금액 |
Example
swap_getLiquidityBalance
전송주소의 유동성 잔고를 반환합니다.
Parameters
Name | Type | Description |
---|---|---|
token0 | String | 토큰 0의 주소 |
token1 | String | 토큰 1의 주소 |
sender | String | 전송주소 |
Return Value
Name | Type | Description |
---|---|---|
balance | BigDecimal | 전송주소의 유동성 잔고 |
amount1 | BigDecimal | 토큰 1의 금액 |
Example
swap_addLiquidity
token0 및 token1 스왑 풀에 유동성을 공급합니다. 호출하기 전에 tokenIn by amountIn 과 tokenOut by amountOut에 대해 swap_approve를 수행해야 합니다.
Parameters
Name | Type | Description |
---|---|---|
amount0 | BigDecimal | 토큰 0의 금액 |
amount1 | BigDecimal | 토큰 1의 금액 |
token0 | String | 토큰 0의 주소 |
token1 | String | 토큰 1의 주소 |
sender | String | 전송주소 |
comment | String | 코멘트: 200자 제한 |
tempKey | String | tempKey for "addLiquidity" |
hashKey | String | hash(tempKey | secretKey) |
signature | String | sign( hash( amount0 | amount1 | token0 | token1 | sender | tempKey | hashKey ) ) by sender's privateKey using signData API |
거래를 수행하기 위해 소유자는 가스 비용을 위한 최소 2 GPEI의 잔액이 있어야 합니다.
Return Value
Name | Type | Description |
---|---|---|
transactionId | String | 트랜잭션 ID |
transactionId가 반환되지만 이것이 아직 블록에 추가되었다는 의미는 아닙니다. net_getTransactionStatus를 사용하여 상태가 1인지 확인해야 합니다.
Example
swap_removeLiquidity
token0 및 token1 스왑 풀에서 유동성을 제거합니다. 호출하기 전에 token0 및 token1에 대해 swap_approveLiquidity를 수행해야 합니다.
Parameters
Name | Type | Description |
---|---|---|
liquidity | BigDecimal | 제거할금액 |
token0 | String | 토큰 0의 주소 |
token1 | String | 토큰 1의 주소 |
sender | String | 전송주소 |
comment | String | 코멘트: 200자 제한 |
tempKey | String | tempKey for "removeLiquidity" |
hashKey | String | hash(tempKey | secretKey) |
signature | String | sign( hash( liquidity | token0 | token1 | sender | tempKey | hashKey ) ) by sender's privateKey using signData API |
거래를 수행하기 위해 소유자는 가스 비용을 위한 최소 2 GPEI의 잔액이 있어야 합니다.
Return Value
Name | Type | Description |
---|---|---|
transactionId | String | 트랜잭션 ID |
transactionId가 반환되지만 이것이 아직 블록에 추가되었다는 의미는 아닙니다. net_getTransactionStatus를 사용하여 상태가 1인지 확인해야 합니다.
Example
swap_approve
소유자 주소에서 토큰의 스왑을 승인합니다.
Parameters
Name | Type | Description |
---|---|---|
contractAddress | String | 토큰의컨트랙주소 |
sender | String | 전송주소 |
amount | BigDecimal | 승인금액. |
comment | String | 코멘트: 200자 제한 |
tempKey | String | tempKey for "approve" |
hashKey | String | hash(tempKey | fromAddress' secretKey) |
signature | String | sign( hash ( contractAddress | sender | amount | tempKey | hashKey ) ) by sender's privateKey using signData API |
거래를 수행하기 위해 소유자는 가스 비용을 위한 최소 100MPEI의 잔액이 있어야 합니다.
Return Value
Name | Type | Description |
---|---|---|
transactionId | String | 트랜잭션 ID |
transactionId가 반환되지만 이것이 아직 블록에 추가되었다는 의미는 아닙니다. net_getTransactionStatus를 사용하여 상태가 1인지 확인해야 합니다.
Example
swap_getAllowance
소유자 주소에서 지출자 주소로 스왑이 허용된 토큰 금액을 반환합니다.
Parameters
Name | Type | Description |
---|---|---|
contractAddress | String | 토큰의 컨트랙주소. |
address | String | 소유자 주소 |
spender | String | 지출자 주소 |
Return Value
Name | Type | Description |
---|---|---|
amount | BigDecimal | 허용된 토큰 금액. |
Example
swap_approveLiquidity
소유자 주소에서 유동성 토큰의 스왑을 위해 유동성 제거를 승인하십시오.
Parameters
Name | Type | Description |
---|---|---|
token0 | String | 토큰0의 주소 |
token1 | String | 토큰0의 주소 |
sender | String | 전송주소 |
amount | BigDecimal | 승인금액 |
comment | String | 코멘트: 200자 제한 |
tempKey | String | tempKey for "approve" |
hashKey | String | hash(tempKey | fromAddress' secretKey) |
signature | String | sign( hash ( token0 | token1 | sender | amount | tempKey | hashKey ) ) by sender's privateKey using signData API |
거래를 수행하기 위해 소유자는 가스 비용을 위한 최소 100MPEI의 잔액이 있어야 합니다..
Return Value
Name | Type | Description |
---|---|---|
transactionId | String | 트랜잭션 ID |
transactionId가 반환되지만 이것이 아직 블록에 추가되었다는 의미는 아닙니다. net_getTransactionStatus를 사용하여 상태가 1인지 확인해야 합니다.
Example
swap_getAllowanceLiquidity
소유자 주소에서 지출자 주소로 스왑시에 허용된 유동성 토큰 금액을 반환합니다.
Parameters
Name | Type | Description |
---|---|---|
token0 | String | 토큰0의 주소 |
token1 | String | 토큰1의 주소 |
address | String | 소유 주소 |
spender | String | 지출자 주소 |
Return Value
Name | Type | Description |
---|---|---|
amount | BigDecimal | 허용된 토큰 금액 |
Example
Last updated