For the complete documentation index, see llms.txt. This page is also available as Markdown.

PizzaSwap

Swap's global configuration information.

get
/v1/brc20-swap/config
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/config
GET /v1/brc20-swap/config HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "moduleId": "text",
    "serviceGasTick": "text",
    "pendingDepositDirectNum": 1,
    "pendingDepositMatchingNum": 1
  }
}

Gets the balance for the specified address and tick.

get
/v1/brc20-swap/balance
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tickstringRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/balance
GET /v1/brc20-swap/balance?address=text&tick=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "balance": {
      "module": "text",
      "swap": "text",
      "pendingSwap": "text",
      "pendingAvailable": "text"
    },
    "decimal": "text"
  }
}

Get Pool information based on trade pair.

get
/v1/brc20-swap/pool_info
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
tick0stringOptional
tick1stringOptional
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/pool_info
GET /v1/brc20-swap/pool_info HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "existed": true,
    "addLiq": true,
    "tick0": "text",
    "tick1": "text",
    "lp": "text",
    "tvl": "text",
    "volume24h": "text",
    "volume7d": "text"
  }
}

Select the tick information that you can use based on the address.

get
/v1/brc20-swap/select
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
searchstringOptional

Fuzzy matching

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/select
GET /v1/brc20-swap/select?address=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

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.

get
/v1/brc20-swap/pre_deploy_pool
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tick0stringRequired
tick1stringRequired
tsnumberRequired

Timestamp (seconds)

feeTickstringRequired

Tick used as fee

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/pre_deploy_pool
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "ids": [
      "text"
    ],
    "signMsgs": [
      "text"
    ],
    "feeAmount": "text",
    "feeTickPrice": "text",
    "feeBalance": "text"
  }
}

Deploy the pool operation.

post
/v1/brc20-swap/deploy_pool
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
addressstringRequired
tick0stringRequired
tick1stringRequired
tsnumberRequired

Timestamp (seconds)

feeTickstringRequired

Tick used as fee

feeAmountstringRequired

The fee that the user needs to pay

feeTickPricestringRequired

The price of fee tick

sigsstring[]Optional

User signature

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
dataobjectRequired
post/v1/brc20-swap/deploy_pool
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"
  ]
}
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {}
}

/add_liq interface pre-load, get the signature content, gas and byte information.

get
/v1/brc20-swap/pre_add_liq
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tick0stringRequired
tick1stringRequired
amount0stringRequired

Input amount of tick0

amount1stringRequired

Input amount of tick1

lpstringRequired

Expect amount of lp

slippagestringRequired
tsnumberRequired

Timestamp (seconds)

feeTickstringRequired

Tick used as fee

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/pre_add_liq
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "ids": [
      "text"
    ],
    "signMsgs": [
      "text"
    ],
    "feeAmount": "text",
    "feeTickPrice": "text",
    "feeBalance": "text"
  }
}

Add the liquidity operation.

post
/v1/brc20-swap/add_liq
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
addressstringRequired
tick0stringRequired
tick1stringRequired
amount0stringRequired

Input amount of tick0

amount1stringRequired

Input amount of tick1

lpstringRequired
slippagestringRequired
tsnumberRequired

Timestamp (seconds)

feeTickstringRequired

Tick used as fee

feeAmountstringRequired

The fee that the user needs to pay

feeTickPricestringRequired

The price of fee tick

sigsstring[]Optional

User signature

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
post/v1/brc20-swap/add_liq
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"
  ]
}
200

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.

get
/v1/brc20-swap/pre_remove_liq
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tick0stringRequired
tick1stringRequired
amount0stringRequired

Input amount of tick0

amount1stringRequired

Input amount of tick1

lpstringRequired
slippagestringRequired
tsnumberRequired
feeTickstringRequired

Tick used as fee

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/pre_remove_liq
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "ids": [
      "text"
    ],
    "signMsgs": [
      "text"
    ],
    "feeAmount": "text",
    "feeTickPrice": "text",
    "feeBalance": "text"
  }
}

Remove the liquidity operation

post
/v1/brc20-swap/remove_liq
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
addressstringRequired
tick0stringRequired
tick1stringRequired
lpstringRequired
amount0stringRequired

Input amount of tick0

amount1stringRequired

Input amount of tick1

slippagestringRequired
tsnumberRequired

Timestamp (seconds)

feeTickstringRequired

Tick used as fee

feeAmountstringRequired

The fee that the user needs to pay

feeTickPricestringRequired

The price of fee tick

sigsstring[]Optional

User signature

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
post/v1/brc20-swap/remove_liq
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"
  ]
}
200

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.

get
/v1/brc20-swap/pre_send
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tickstringRequired

Send tick

amountstringRequired

The amount of send tick

tostringRequired

The receiver of send tick

tsnumberRequired

Timestamp (seconds)

feeTickstringRequired

Tick used as fee

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/pre_send
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "ids": [
      "text"
    ],
    "signMsgs": [
      "text"
    ],
    "feeAmount": "text",
    "feeTickPrice": "text",
    "feeBalance": "text"
  }
}

/swap interface pre-load, get the signature content and gas information.

get
/v1/brc20-swap/pre_swap
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tickInstringRequired

Input tick

tickOutstringRequired

Output tick

amountInstringRequired

The amount of input tick

amountOutstringRequired

The amount of output tick

slippagestringRequired
exactTypestring · enumRequiredExample: exactInPossible values:
tsnumberRequired

Timestamp(seconds)

feeTickstringRequired

Tick used as fee

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/pre_swap
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "ids": [
      "text"
    ],
    "signMsgs": [
      "text"
    ],
    "feeAmount": "text",
    "feeTickPrice": "text",
    "feeBalance": "text"
  }
}

The send operation.

post
/v1/brc20-swap/send
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
addressstringRequired
tickstringRequired

Send tick

amountstringRequired

The amount of send tick

tostringRequired

The receiver of send tick

tsnumberRequired

Timestamp (seconds)

feeTickstringRequired

Tick used as fee

feeAmountstringRequired

The fee that the user needs to pay

feeTickPricestringRequired

The price of fee tick

sigsstring[]Optional

User signature

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
dataobjectRequired
post/v1/brc20-swap/send
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"
  ]
}
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {}
}

The swap operation.

post
/v1/brc20-swap/swap
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
addressstringRequired
tickInstringRequired

Input tick

tickOutstringRequired

Output tick

amountInstringRequired

The amount of input tick

amountOutstringRequired

The amount of output tick

feeTickstringRequired
slippagestringRequired
exactTypestring · enumRequiredPossible values:
tsnumberRequired

Timestamp (seconds)

feeAmountstringRequired

The fee that the user needs to pay

feeTickPricestringRequired

The price of fee tick

sigsstring[]Optional

User signature

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
post/v1/brc20-swap/swap
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"
  ]
}
200

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
  }
}

Gets the pool list information.

get
/v1/brc20-swap/pool_list
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
searchstringOptional

Fuzzy matching

startnumberRequired
limitnumberRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/pool_list
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "total": 1,
    "list": [
      {
        "tick0": "text",
        "tick1": "text",
        "lp": "text",
        "tvl": "text",
        "volume24h": "text",
        "volume7d": "text"
      }
    ]
  }
}

Gets the pool list information by address.

get
/v1/brc20-swap/my_pool_list
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tickstringOptional
startnumberRequired
limitnumberRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/my_pool_list
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "total": 1,
    "list": [
      {
        "lp": "text",
        "shareOfPool": "text",
        "tick0": "text",
        "tick1": "text",
        "amount0": "text",
        "amount1": "text"
      }
    ]
  }
}

Gets the user pool information for the specified pair.

get
/v1/brc20-swap/my_pool
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tick0stringRequired
tick1stringRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/my_pool
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "lp": "text",
    "shareOfPool": "text",
    "tick0": "text",
    "tick1": "text",
    "amount0": "text",
    "amount1": "text"
  }
}

An overview of swap information

get
/v1/brc20-swap/overview
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/overview
GET /v1/brc20-swap/overview HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "liquidity": "text",
    "volume7d": "text",
    "volume24h": "text",
    "transactions": 1,
    "pairs": 1
  }
}

Gets the gas consumption records for a user aggregation operation.

get
/v1/brc20-swap/gas_history
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringOptional
startnumberRequired
limitnumber · max: 100Required
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/gas_history
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "total": 1,
    "list": [
      {
        "funcType": "swap",
        "tickA": "text",
        "tickB": "text",
        "gas": "text",
        "ts": 1
      }
    ]
  }
}

Gets the history of send transaction.

get
/v1/brc20-swap/send_history
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringOptional
tickstringOptional
startnumberRequired
limitnumber · max: 100Required
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/send_history
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "total": 1,
    "list": [
      {
        "tick": "text",
        "amount": "text",
        "to": "text",
        "ts": 1
      }
    ]
  }
}

Gets the history of a pair addition pool.

get
/v1/brc20-swap/liq_history
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringOptional
tickstringOptional
typestringOptional

Optional: add, remove

startnumberRequired
limitnumber · max: 100Required
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/liq_history
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "total": 1,
    "list": [
      {
        "type": "text",
        "tick0": "text",
        "tick1": "text",
        "amount0": "text",
        "amount1": "text",
        "lp": "text",
        "ts": 1
      }
    ]
  }
}

Gets the history of swap.

get
/v1/brc20-swap/swap_history
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringOptional
tickstringOptional
startnumberRequired
limitnumber · max: 100Required
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/swap_history
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "total": 1,
    "list": [
      {
        "tickIn": "text",
        "tickOut": "text",
        "amountIn": "text",
        "amountOut": "text",
        "exactType": "text",
        "ts": 1
      }
    ]
  }
}

Get chain history of rollup inscription.

get
/v1/brc20-swap/rollup_history
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
startnumber · max: 100Required
limitnumber · max: 1000Required
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/rollup_history
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "total": 1,
    "list": [
      {
        "txid": "text",
        "height": 1,
        "transactionNum": 1,
        "inscriptionId": "text",
        "inscriptionNumber": 1,
        "ts": 1
      }
    ]
  }
}

Gets the deposit list for a user.

get
/v1/brc20-swap/deposit_list
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
tickstringOptional
startnumberRequired
limitnumberRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/deposit_list
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "total": 1,
    "list": [
      {
        "tick": "text",
        "amount": "text",
        "cur": 1,
        "sum": 1,
        "ts": 1,
        "txid": "text",
        "type": "text"
      }
    ]
  }
}

Create a deposit psbt to be signed by the user.

get
/v1/brc20-swap/create_deposit
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
inscriptionIdstringRequired
pubkeystringRequired
addressstringRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/create_deposit
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "psbt": "text",
    "type": "text",
    "expiredTimestamp": 1,
    "recommendDeposit": "text"
  }
}

User signature deposit psbt, submit confirmation.

post
/v1/brc20-swap/confirm_deposit
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
psbtstringRequired
inscriptionIdstringRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
dataobjectRequired
post/v1/brc20-swap/confirm_deposit
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"
}
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {}
}

Gets the current system state.

get
/v1/brc20-swap/system_status
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/system_status
GET /v1/brc20-swap/system_status HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "committing": true
  }
}

Gets the user withdrawal history.

get
/v1/brc20-swap/withdraw_history
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
addressstringRequired
startnumberRequired
limitnumberRequired
tickstringOptional
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/withdraw_history
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: */*
200

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"
      }
    ]
  }
}

Retry create a withdraw psbt to be signed by the user.

get
/v1/brc20-swap/create_retry_withdraw
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
idstringRequired
pubkeystringRequired
addressstringRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/create_retry_withdraw
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {
    "paymentPsbt": "text",
    "approvePsbt": "text",
    "networkFee": 1
  }
}

User signature withdraw psbt, submit confirmation.

post
/v1/brc20-swap/confirm_retry_withdraw
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
idstringRequired

The withdraw order id

paymentPsbtstringRequired
approvePsbtstringRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
dataobjectRequired
post/v1/brc20-swap/confirm_retry_withdraw
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"
}
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {}
}

Create a withdraw psbt to be signed by the user.

get
/v1/brc20-swap/create_withdraw
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
pubkeystringRequired
addressstringRequired
tickstringRequired
amountstringRequired
tsnumberRequired
feeTickstringRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
dataobjectRequired
get/v1/brc20-swap/create_withdraw
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: */*
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {}
}

User signature withdraw psbt, submit confirmation.

post
/v1/brc20-swap/confirm_withdraw
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
idstringRequired

The withdraw order id

paymentPsbtstringRequired
approvePsbtstringRequired
feeTickstringRequired
feeAmountstringOptional

The fee that the user needs to pay

feeTickPricestringOptional

The price of fee tick

sigsstring[]Optional

User signature

Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
dataobjectRequired
post/v1/brc20-swap/confirm_withdraw
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"
  ]
}
200

Default Response

{
  "code": 1,
  "msg": "text",
  "data": {}
}

Gets the withdrawal progress for the specified ID.

get
/v1/brc20-swap/withdraw_process
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
idstringRequired
Responses
200

Default Response

application/json
codenumberRequired
msgstringRequired
get/v1/brc20-swap/withdraw_process
GET /v1/brc20-swap/withdraw_process?id=text HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

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