Auction House Receipts
To aid transaction / activity tracking on marketplaces, the Auction House program supports the generation of receipts for listings, bids and sales.
In addition to printing receipts, Auction House cancels receipts when the corresponding instruction (bid, listing or sale) is cancelled.
Let us see how receipts are printed.
To generate these receipts, the receipt printing function should be called immediately after the corresponding transaction (
CancelBidReceipt instructions should be called in the case of canceled listings and bids. Calling these two instructions will fill the
canceled_at fields of the
While the receipts can be retrieved using the standard getProgramAccounts data flow, the official recommendation is to use Solana's AccountsDB plug-in to index and track the generated receipts.
There are two fields that can be introduced to each function above to print the corresponding receipt:
printReceipt: This is a boolean field that defaults to
true. When this field is set to
true, a receipt is printed for the corresponding function.
bookkeeper: The address of the bookkeeper wallet responsible for the receipt. In other words, the bookeeper is the wallet that paid for the receipt. It's only responsibility at this time is tracking the payer of the receipt so that in the future if the account is allowed to be closed the program knows who should be refunded for the rent. This field defaults to
Here's an example of printing receipts for bid, list and execute sale instructions.
// printing the ListReceipt
// printing the BidReceipt
// printing the PurchaseReceipt
Now that we know how to print receipts for easy transaction tracking, how do we actually fetch details regarding these actions in practice? Let us explore ways to find bids, listings and sales for an Auction House in the next page.