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:
0
numberOptional
isExpressBuybooleanOptional
receiverstringOptional
Responses
200Success
post
POST /market/v1/{market}/bulk-buy HTTP/1.1
Host:
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
psbt
from last step's response
const signedPsbt = await unisat.signPsbt(psbt, {
autoFinalized: false
})
Confirm buying
psbt
in the post body is last step'ssignedPsbt
post
Confirm listing
Body
psbtstringRequired
Signed psbt
bidIdsstring[]Required
Responses
200Success
post
POST /market/v1/bid/bulk-confirm HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 33
{
"psbt": "text",
"bidIds": [
"text"
]
}
200Success
{
"success": true
}
Last updated