PizzaSwap

Swap's global configuration information.

get
Authorizations
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/config HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringRequired
tickstringRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/balance HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
tick0stringOptional
tick1stringOptional
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/pool_info HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringRequired
searchstringOptional

Fuzzy matching

Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/select HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringRequired
tick0stringRequired
tick1stringRequired
tsnumberRequired

Timestamp (seconds)

feeTickstringRequired

Tick used as fee

Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/pre_deploy_pool HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
Accept: */*
200

Default Response

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

Deploy the pool operation.

post
Authorizations
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
post
POST /v1/brc20-swap/deploy_pool HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
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
get
GET /v1/brc20-swap/pre_add_liq HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
Accept: */*
200

Default Response

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

Add the liquidity operation.

post
Authorizations
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
post
POST /v1/brc20-swap/add_liq HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
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
get
GET /v1/brc20-swap/pre_remove_liq HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
Accept: */*
200

Default Response

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

Remove the liquidity operation

post
Authorizations
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
post
POST /v1/brc20-swap/remove_liq HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
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
get
GET /v1/brc20-swap/pre_send HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
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
get
GET /v1/brc20-swap/pre_swap HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
Accept: */*
200

Default Response

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

The send operation.

post
Authorizations
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
post
POST /v1/brc20-swap/send HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
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
post
POST /v1/brc20-swap/swap HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
searchstringOptional

Fuzzy matching

startnumberRequired
limitnumberRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/pool_list HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringRequired
tickstringOptional
startnumberRequired
limitnumberRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/my_pool_list HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringRequired
tick0stringRequired
tick1stringRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/my_pool HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/overview HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringOptional
startnumberRequired
limitnumber · max: 100Required
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/gas_history HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringOptional
tickstringOptional
startnumberRequired
limitnumber · max: 100Required
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/send_history HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringOptional
tickstringOptional
typestringOptional

Optional: add, remove

startnumberRequired
limitnumber · max: 100Required
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/liq_history HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringOptional
tickstringOptional
startnumberRequired
limitnumber · max: 100Required
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/swap_history HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
startnumber · max: 100Required
limitnumber · max: 1000Required
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/rollup_history HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
addressstringRequired
tickstringOptional
startnumberRequired
limitnumberRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/deposit_list HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
inscriptionIdstringRequired
pubkeystringRequired
addressstringRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/create_deposit HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
Accept: */*
200

Default Response

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

User signature deposit psbt, submit confirmation.

post
Authorizations
Body
psbtstringRequired
inscriptionIdstringRequired
Responses
200
Default Response
application/json
post
POST /v1/brc20-swap/confirm_deposit HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/system_status HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
Accept: */*
200

Default Response

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

Gets the user withdrawal history.

get
Authorizations
Query parameters
addressstringRequired
startnumberRequired
limitnumberRequired
tickstringOptional
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/withdraw_history HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
idstringRequired
pubkeystringRequired
addressstringRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/create_retry_withdraw HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
Accept: */*
200

Default Response

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

User signature withdraw psbt, submit confirmation.

post
Authorizations
Body
idstringRequired

The withdraw order id

paymentPsbtstringRequired
approvePsbtstringRequired
Responses
200
Default Response
application/json
post
POST /v1/brc20-swap/confirm_retry_withdraw HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
pubkeystringRequired
addressstringRequired
tickstringRequired
amountstringRequired
tsnumberRequired
feeTickstringRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/create_withdraw HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
Accept: */*
200

Default Response

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

User signature withdraw psbt, submit confirmation.

post
Authorizations
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
post
POST /v1/brc20-swap/confirm_withdraw HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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
Authorizations
Query parameters
idstringRequired
Responses
200
Default Response
application/json
get
GET /v1/brc20-swap/withdraw_process HTTP/1.1
Host: open-api-fractal.unisat.io
Authorization: Bearer JWT
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