Assets Buying
Workflow for assets buying.
Prepare buying
post
Prepare buy
Path parameters
marketanyRequired
"token"|"collection|"realm"
Body
bidIdsstring[]Required
buyerstringRequired
gasRateany ofRequired
string · numericOptionalDefault:
0numberOptional
isExpressBuybooleanOptional
receiverstringOptional
Responses
200Success
bidIdsstring[]Required
gasCostnumberRequired
psbtstringRequired
serviceFeenumberRequired
txSizenumberRequired
signIndexesnumber[]Required
post/market/v1/{market}/bulk-buy
POST /market/v1/{market}/bulk-buy HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 119
{
"bidIds": [
"text"
],
"buyer": "text",
"gasRate": 0,
"isExpressBuy": true,
"receiver": "text",
"utxos": [
{
"txid": "text",
"vout": 1
}
]
}200Success
{
"bidIds": [
"text"
],
"gasCost": 1,
"psbt": "text",
"serviceFee": 1,
"txSize": 1,
"signIndexes": [
1
]
}Client sign
psbtfrom last step's response
const signedPsbt = await unisat.signPsbt(psbt, {
autoFinalized: false
})Confirm buying
psbtin the post body is last step'ssignedPsbt
post
Confirm listing
Body
psbtstringRequired
Signed psbt
bidIdsstring[]Required
Responses
200Success
successbooleanRequired
post/market/v1/bid/bulk-confirm
POST /market/v1/bid/bulk-confirm HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 33
{
"psbt": "text",
"bidIds": [
"text"
]
}200Success
{
"success": true
}Last updated