Let's walk through the steps required to list via API on Satflow.
Listing on Satflow programatically involves a few things:
- Generating Listing PSBTs using
/intent/sell - Signing all Listing PSBTs using local wallet software
- Submitting all Signed PSBTs to
/list
Generating Listing PSBTs
You need a few things to generate a listing PSBT
collection_slugis entirely optional, no need to provide this.- Required fields:
inscription_idorrunes_output- one of these is required to indicate which item is being listedord_addressThis is the owner address of the specified itemreceive_addressThis is the address for receiving payment from the saleprice- The listing price, in satoshistap_key- The public key oford_address, usually 66 characters long, and is hexadecimal format
Now you need to POST /intent/sell with these included in the body.
You will receive unsignedListingPSBTBase64 and secureListingPSBTs. Since you're listing one item, you will receive a total of 2 PSBTs to sign.
Signing all Listing PSBTs using local wallet software
One of these is for the insecure (snipable) with sighash SINGLE | ANYONECANPAY. The other is for secure listing (where sniping is not possible) and this is sighash ALL | ANYONECANPAY.
You will need to sign these two PSBTs using a wallet of your choice. The insecure listing PSBT has only one input - you can just sign that. The secure listing PSBT provides a indicesToSign field.
Make sure you are signing with the correct sighash at the correct indices.
Submitting all Signed PSBTs to/list
Now that you have signed both PSBTs, you will need to reuse the original parameters which generated the listing (required fields in section 1 of this guide).
In addition to those parameters you need
signed_listing_psbtin base64 or hexsigned_secure_listing_psbtin base64 or hexunsigned_listing_psbtis optional!
POST /sell with these parameters and you've successfully listed!
Notes
To edit a listing you are not required to cancel a listing first, just repeat the above steps to replace your listing.
