Core API

GET https://api2.chainge.finance/fun/getVault

Query Parameters

Name
Type
Description

ticker*

String

krc20 ticker

{
    "code": 0,
    "msg": "success",
    "data": {
        "vault": "kaspa:qp6fny54gn7ydnxaltmmezc60qnleksxu6ctvtjch2dlvkvg8pak6rh33st6w"
    }
}

GET https://api2.chainge.finance/fun/quote

Query Parameters

Name
Type
Description

fromTicker*

String

krc20 ticker

toTicker*

String

krc20 ticker

fromAmount*

String

BigNumber String. ex: 10 kas , 1000000000

{
    "code": 0,
    "msg": "success",
    "data": {
        "amountOut": "75553316920000",
        "amountOutUsd": "1.14",
        "userAmountOut": "38702849054762",
        "serviceFee": "2266599507600",
        "gasFee": "34583868357638",
        "serviceFeeRate": "3%",
        "priceImpact": "0.61%",
        "slippage": "5%"
    }
}

POST https://api2.chainge.finance/fun/submitSwap

Query Parameters

Name
Type
Description

channel*

String

Unique KEY. ex: knot

certHash*

String

Transaction hash

fromTicker*

String

krc20 ticker

fromAmount*

String

BigNumber String. ex: 10 kas , 1000000000

toTicker*

String

krc20 ticker

toAmount*

String

BigNumber String. ex: 10 kas , 1000000000

toAmountMin*

String

BigNumber String.

Headers Parameters

Name
Type
Description

Address*

String

User address

PublicKey*

String

User publicKey

Chain*

String

KAS

Signature*

String

Verify signature

GET https://api2.chainge.finance/fun/checkSwap

Query Parameters

Name
Type
Description

id*

String

submitSwap result, order id

status:

Unknown, Refunding, Pending //all regarded as pending

Succeeded //order executed successfully

Dropped //order dropped for any reasons, manual refund is needed

Refunded //order cannot proceed for any reasons, system refunded automatically

example:

This example is for demonstration purposes only.

Last updated

Was this helpful?