Assets Listing
Workflow for listing creation, fetching and deletion.
Prepare listing (to generate unsigned psbt for client to sign)
Prepare listing
Only support "token" for now.
Client sign
psbtfrom last step's response
import { Psbt, Transaction } from "bitcoinjs-lib";
const sellerPsbt = Psbt.fromHex(psbt);
const toSignInputs = sellerPsbt.data.inputs.map((_, index) => ({
address, // seller address
index,
sighashTypes: [
Transaction.SIGHASH_SINGLE | Transaction.SIGHASH_ANYONECANPAY,
],
}));
// injectProvider could be unisat (https://docs.unisat.io/dev/unisat-wallet-api)
const signedSellerPsbt = await injectProvider.signPsbt(psbt, {
autoFinalized: false,
toSignInputs: toSignInputs,
});Confirm listing
psbtin the post body is last step'ssignedSellerPsbt
Confirm listing
Signed psbt
Get listings by address
Get listing history by wallet and ticker. Deprecated, use /:market/:wallet/listing instead.
"token"|"collection|"realm"
Delist listing
Generate the message to be signed by the client:
const generateSigningMessage = (bidId) => You are signing this message to unlist your asset (Listing ID: ${bidId}) from AM.Get
sigby signing the message (eg using https://docs.unisat.io/dev/unisat-developer-service/unisat-wallet#signmessage)Post by /market/v1/token_atom/unlist
"token"|"collection|"realm"
From signing the message: "You are signing this message to unlist your asset (Listing ID: [:bidId]) from AM.
Last updated