PizzaSwap
Default Response
GET /v1/brc20-swap/config HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"moduleId": "text",
"serviceGasTick": "text",
"pendingDepositDirectNum": 1,
"pendingDepositMatchingNum": 1
}
}Default Response
GET /v1/brc20-swap/balance?address=text&tick=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"balance": {
"module": "text",
"swap": "text",
"pendingSwap": "text",
"pendingAvailable": "text"
},
"decimal": "text"
}
}Default Response
GET /v1/brc20-swap/pool_info HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"existed": true,
"addLiq": true,
"tick0": "text",
"tick1": "text",
"lp": "text",
"tvl": "text",
"volume24h": "text",
"volume7d": "text"
}
}Fuzzy matching
Default Response
GET /v1/brc20-swap/select?address=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": [
{
"tick": "text",
"decimal": "text",
"brc20Balance": "text",
"swapBalance": "text"
}
]
}/deploy_pool interface pre-load, get the signature content, gas and byte information.
Timestamp (seconds)
Tick used as fee
Default Response
GET /v1/brc20-swap/pre_deploy_pool?address=text&tick0=text&tick1=text&ts=1&feeTick=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"ids": [
"text"
],
"signMsgs": [
"text"
],
"feeAmount": "text",
"feeTickPrice": "text",
"feeBalance": "text"
}
}Timestamp (seconds)
Tick used as fee
The fee that the user needs to pay
The price of fee tick
User signature
Default Response
POST /v1/brc20-swap/deploy_pool HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 129
{
"address": "text",
"tick0": "text",
"tick1": "text",
"ts": 1,
"feeTick": "text",
"feeAmount": "text",
"feeTickPrice": "text",
"sigs": [
"text"
]
}Default Response
{
"code": 1,
"msg": "text",
"data": {}
}/add_liq interface pre-load, get the signature content, gas and byte information.
Input amount of tick0
Input amount of tick1
Expect amount of lp
Timestamp (seconds)
Tick used as fee
Default Response
GET /v1/brc20-swap/pre_add_liq?address=text&tick0=text&tick1=text&amount0=text&amount1=text&lp=text&slippage=text&ts=1&feeTick=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"ids": [
"text"
],
"signMsgs": [
"text"
],
"feeAmount": "text",
"feeTickPrice": "text",
"feeBalance": "text"
}
}Input amount of tick0
Input amount of tick1
Timestamp (seconds)
Tick used as fee
The fee that the user needs to pay
The price of fee tick
User signature
Default Response
POST /v1/brc20-swap/add_liq HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 193
{
"address": "text",
"tick0": "text",
"tick1": "text",
"amount0": "text",
"amount1": "text",
"lp": "text",
"slippage": "text",
"ts": 1,
"feeTick": "text",
"feeAmount": "text",
"feeTickPrice": "text",
"sigs": [
"text"
]
}Default Response
{
"code": 1,
"msg": "text",
"data": {
"id": "text",
"rollupInscriptionId": "text",
"address": "text",
"type": "text",
"tick0": "text",
"tick1": "text",
"amount0": "text",
"amount1": "text",
"lp": "text",
"ts": 1
}
}/remove_liq interface pre-load, get the signature content, gas and byte information.
Input amount of tick0
Input amount of tick1
Tick used as fee
Default Response
GET /v1/brc20-swap/pre_remove_liq?address=text&tick0=text&tick1=text&amount0=text&amount1=text&lp=text&slippage=text&ts=1&feeTick=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"ids": [
"text"
],
"signMsgs": [
"text"
],
"feeAmount": "text",
"feeTickPrice": "text",
"feeBalance": "text"
}
}Input amount of tick0
Input amount of tick1
Timestamp (seconds)
Tick used as fee
The fee that the user needs to pay
The price of fee tick
User signature
Default Response
POST /v1/brc20-swap/remove_liq HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 193
{
"address": "text",
"tick0": "text",
"tick1": "text",
"lp": "text",
"amount0": "text",
"amount1": "text",
"slippage": "text",
"ts": 1,
"feeTick": "text",
"feeAmount": "text",
"feeTickPrice": "text",
"sigs": [
"text"
]
}Default Response
{
"code": 1,
"msg": "text",
"data": {
"id": "text",
"rollupInscriptionId": "text",
"address": "text",
"type": "text",
"tick0": "text",
"tick1": "text",
"amount0": "text",
"amount1": "text",
"lp": "text",
"ts": 1
}
}/send interface pre-load, get the signature content, gas and byte information.
Send tick
The amount of send tick
The receiver of send tick
Timestamp (seconds)
Tick used as fee
Default Response
GET /v1/brc20-swap/pre_send?address=text&tick=text&amount=text&to=text&ts=1&feeTick=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"ids": [
"text"
],
"signMsgs": [
"text"
],
"feeAmount": "text",
"feeTickPrice": "text",
"feeBalance": "text"
}
}Input tick
Output tick
The amount of input tick
The amount of output tick
exactInPossible values: Timestamp(seconds)
Tick used as fee
Default Response
GET /v1/brc20-swap/pre_swap?address=text&tickIn=text&tickOut=text&amountIn=text&amountOut=text&slippage=text&exactType=exactIn&ts=1&feeTick=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"ids": [
"text"
],
"signMsgs": [
"text"
],
"feeAmount": "text",
"feeTickPrice": "text",
"feeBalance": "text"
}
}Send tick
The amount of send tick
The receiver of send tick
Timestamp (seconds)
Tick used as fee
The fee that the user needs to pay
The price of fee tick
User signature
Default Response
POST /v1/brc20-swap/send HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 141
{
"address": "text",
"tick": "text",
"amount": "text",
"to": "text",
"ts": 1,
"feeTick": "text",
"feeAmount": "text",
"feeTickPrice": "text",
"sigs": [
"text"
]
}Default Response
{
"code": 1,
"msg": "text",
"data": {}
}Input tick
Output tick
The amount of input tick
The amount of output tick
Timestamp (seconds)
The fee that the user needs to pay
The price of fee tick
User signature
Default Response
POST /v1/brc20-swap/swap HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 209
{
"address": "text",
"tickIn": "text",
"tickOut": "text",
"amountIn": "text",
"amountOut": "text",
"feeTick": "text",
"slippage": "text",
"exactType": "exactIn",
"ts": 1,
"feeAmount": "text",
"feeTickPrice": "text",
"sigs": [
"text"
]
}Default Response
{
"code": 1,
"msg": "text",
"data": {
"id": "text",
"rollupInscriptionId": "text",
"address": "text",
"tickIn": "text",
"tickOut": "text",
"amountIn": "text",
"amountOut": "text",
"exactType": "text",
"ts": 1
}
}Fuzzy matching
Default Response
GET /v1/brc20-swap/pool_list?start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"tick0": "text",
"tick1": "text",
"lp": "text",
"tvl": "text",
"volume24h": "text",
"volume7d": "text"
}
]
}
}Default Response
GET /v1/brc20-swap/my_pool_list?address=text&start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"lp": "text",
"shareOfPool": "text",
"tick0": "text",
"tick1": "text",
"amount0": "text",
"amount1": "text"
}
]
}
}Default Response
GET /v1/brc20-swap/my_pool?address=text&tick0=text&tick1=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"lp": "text",
"shareOfPool": "text",
"tick0": "text",
"tick1": "text",
"amount0": "text",
"amount1": "text"
}
}Default Response
GET /v1/brc20-swap/overview HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"liquidity": "text",
"volume7d": "text",
"volume24h": "text",
"transactions": 1,
"pairs": 1
}
}Default Response
GET /v1/brc20-swap/gas_history?start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"funcType": "swap",
"tickA": "text",
"tickB": "text",
"gas": "text",
"ts": 1
}
]
}
}Default Response
GET /v1/brc20-swap/send_history?start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"tick": "text",
"amount": "text",
"to": "text",
"ts": 1
}
]
}
}Optional: add, remove
Default Response
GET /v1/brc20-swap/liq_history?start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"type": "text",
"tick0": "text",
"tick1": "text",
"amount0": "text",
"amount1": "text",
"lp": "text",
"ts": 1
}
]
}
}Default Response
GET /v1/brc20-swap/swap_history?start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"tickIn": "text",
"tickOut": "text",
"amountIn": "text",
"amountOut": "text",
"exactType": "text",
"ts": 1
}
]
}
}Default Response
GET /v1/brc20-swap/rollup_history?start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"txid": "text",
"height": 1,
"transactionNum": 1,
"inscriptionId": "text",
"inscriptionNumber": 1,
"ts": 1
}
]
}
}Default Response
GET /v1/brc20-swap/deposit_list?address=text&start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"tick": "text",
"amount": "text",
"cur": 1,
"sum": 1,
"ts": 1,
"txid": "text",
"type": "text"
}
]
}
}Default Response
GET /v1/brc20-swap/create_deposit?inscriptionId=text&pubkey=text&address=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"psbt": "text",
"type": "text",
"expiredTimestamp": 1,
"recommendDeposit": "text"
}
}Default Response
POST /v1/brc20-swap/confirm_deposit HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"psbt": "text",
"inscriptionId": "text"
}Default Response
{
"code": 1,
"msg": "text",
"data": {}
}Default Response
GET /v1/brc20-swap/system_status HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"committing": true
}
}Default Response
GET /v1/brc20-swap/withdraw_history?address=text&start=1&limit=1 HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"total": 1,
"list": [
{
"id": "text",
"tick": "text",
"totalAmount": "text",
"completedAmount": "text",
"ts": 1,
"totalConfirmedNum": 1,
"totalNum": 1,
"status": "text",
"type": "text"
}
]
}
}Default Response
GET /v1/brc20-swap/create_retry_withdraw?id=text&pubkey=text&address=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"paymentPsbt": "text",
"approvePsbt": "text",
"networkFee": 1
}
}The withdraw order id
Default Response
POST /v1/brc20-swap/confirm_retry_withdraw HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 55
{
"id": "text",
"paymentPsbt": "text",
"approvePsbt": "text"
}Default Response
{
"code": 1,
"msg": "text",
"data": {}
}Default Response
GET /v1/brc20-swap/create_withdraw?pubkey=text&address=text&tick=text&amount=text&ts=1&feeTick=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {}
}The withdraw order id
The fee that the user needs to pay
The price of fee tick
User signature
Default Response
POST /v1/brc20-swap/confirm_withdraw HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 129
{
"id": "text",
"paymentPsbt": "text",
"approvePsbt": "text",
"feeTick": "text",
"feeAmount": "text",
"feeTickPrice": "text",
"sigs": [
"text"
]
}Default Response
{
"code": 1,
"msg": "text",
"data": {}
}Default Response
GET /v1/brc20-swap/withdraw_process?id=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Default Response
{
"code": 1,
"msg": "text",
"data": {
"id": "text",
"tick": "text",
"amount": "text",
"ts": 1,
"status": "text",
"totalConfirmedNum": 1,
"totalNum": 1,
"rollUpConfirmNum": 1,
"rollUpTotalNum": 1,
"approveConfirmNum": 1,
"approveTotalNum": 1,
"cancelConfirmedNum": 1,
"cancelTotalNum": 1,
"rollUpTxid": "text",
"paymentTxid": "text",
"inscribeTxid": "text",
"approveTxid": "text",
"completedAmount": "text",
"matchHistory": [
{
"approveInscriptionId": "text",
"transferInscriptionId": "text",
"tick": "text",
"consumeAmount": "text",
"remainAmount": "text",
"approveAddress": "text",
"transferAddress": "text",
"txid": "text",
"ts": 1
}
]
}
}Last updated