List/Delist NFT
Listing and delisting on the hyperspace contract
For the beta we will start with allowing users to be able to list and delist NFTs on the hyperspace contract. The Hyperspace contract takes a .5% platform fee that the seller pays. It allows for builders to add custom fees on either buyer or seller side.
The listing function on the hyperspace contract allows you to set seller fees for anyone who lists on your platform.
Function: createListTx
Inputs:
- [Required] sellerAddress
- Type: string
- Description: The seller of the NFT
- [Required] price
- Type: number
- Description: Price in sol of item
- [Required] tokenAddress
- Type: string
- Description: Token Address to be listed
- [Required] sellerBroker
- Type: string
- Description: The wallet address that collects the seller fees.
- Please use the treasury wallet address you provided to us in the API form, so we can identify that the call is coming from your platform. If your treasury wallet has changed reach out to us to let us know.
- [Optional] sellerBrokerBasisPoints
- Type: number
- Default Value: 0
- Description: Basis points that the seller broker can collect
Response:
GetListTxQuery
Example:
Create a listing for a serum surfer for 200 SOL and not collecting a fee if it sells
const input: GetListTxQueryVariables = {
tokenAddress: "9ZYc1p5zamyCjbRsp2NNZTQ4sXwKwbf9V5EUYVxpF8nN",
sellerAddress: "Bnxf8Kz5TG6YUeyw9pTFPGMaazNswsoEvqgUVL7ekG9C",
price: 200,
sellerBroker: "Bnxf8Kz5TG6YUeyw9pTFPGMaazNswsoEvqgUVL7ekG9C",
sellerBrokerBasisPoints: 0
}
hsClient.createListTx(input)
// Get buffer response from above sign and send to chain
Creating a listing my serum surfer for 200 SOL and collecting .5% of fees if it sells
Seller pays 1% (.5% platform to hyperspace and .5% to seller broker)
const input: GetListTxQueryVariables = {
tokenAddress: "9ZYc1p5zamyCjbRsp2NNZTQ4sXwKwbf9V5EUYVxpF8nN",
sellerAddress: "Bnxf8Kz5TG6YUeyw9pTFPGMaazNswsoEvqgUVL7ekG9C",
price: 200,
sellerBroker: "Bnxf8Kz5TG6YUeyw9pTFPGMaazNswsoEvqgUVL7ekG9C",
sellerBrokerBasisPoints: 50
}
hsClient.createListTx(input)
// Get buffer response from above sign and send to chain
Function: createDelistTx
Inputs:
- [Required] sellerAddress
- Type: string
- Description: The seller of the listing
- [Required] tokenAddress
- Type: string
- Description: The token address of the NFT
Response:
GetDelistTxQuery
Example:
const input: GetDelistTxQueryVariables = {
tokenAddress: "9ZYc1p5zamyCjbRsp2NNZTQ4sXwKwbf9V5EUYVxpF8nN",
sellerAddress: "Bnxf8Kz5TG6YUeyw9pTFPGMaazNswsoEvqgUVL7ekG9C",
}
hsClient.createDelistTx(input)
Last modified 1yr ago