Last updated 1 year ago
Please note that access to this API requires the API key to have brc20-swap permissions enabled.
Default Response
The withdraw order id
const response = await fetch('https://open-api.unisat.io/v1/brc20-swap/create_withdraw?pubkey=text&address=text&tick=text&amount=text&ts=0', { method: 'GET', headers: { "Authorization": "Bearer JWT" }, }); const data = await response.json();
{ "code": 0, "msg": "text", "data": { "id": "text", "paymentPsbt": "text", "approvePsbt": "text", "networkFee": 0, "signMsg": "text", "bytesL1": 0, "bytesL2": 0, "feeRate": "text", "gasPrice": "text", "serviceFeeL1": "text", "serviceFeeL2": "text", "unitUsdPriceL1": "text", "unitUsdPriceL2": "text", "serviceTickBalance": "text" } }
const response = await fetch('https://open-api.unisat.io/v1/brc20-swap/confirm_withdraw', { method: 'POST', headers: { "Authorization": "Bearer JWT", "Content-Type": "application/json" }, body: JSON.stringify({ "id": "text", "sig": "text", "paymentPsbt": "text", "approvePsbt": "text" }), }); const data = await response.json();
{ "code": 0, "msg": "text", "data": {} }