Buy NFT
Buying an NFT is key to the marketplace - the following endpoints show what data needs to be displayed to receive well-built transactions, confirm transactions and what to show endusers.
If you did not already, please make yourself familiar with the general transaction documentation.
POST/v1/buy/hashpack
Retrieve NFT Buy Transaction - Hashpack
This endpoint allows you to post the HashGuild API and retrieve a Hashpack transaction string to direct to the Hashpack extension.
Required attributes
- Name
accountId
- Type
- string
- Description
The account id of the user wishing to list the NFT.
- Name
tokenId
- Type
- string
- Description
The token id of the NFT to be listed.
- Name
serialNo
- Type
- integer
- Description
The serial number of the NFT to be listed.
Request
POST
/v1/buy/hashpack curl -X https://hashguild.xyz/api/v1/buy/hashpack \
-H "Authorization: Bearer {token}"
-d "{
"accountId": "<accountId>",
"tokenId": "<tokenId>",
"serialNo": "<serialNumber>",
}"
Response
{
"byteArray": "CrkCKrYCCssBChsKDAitq9adBhC244DZARIJCAAQABiUmrAQGAASBggAEAAYAxiAwtcvIgIIeDJCUHVyY2hhc2luZyBORlQgd2l0aCAwLjAuNDkxMzk0OTggYW5kIFNlcmlhbCBOdW1iZXIgMSBmb3IgMjIyIEhCQVIuclcKLAoUCgkIABAAGKHnnBAQgPjIs6UBGAAKFAoJCAAQABiUmrAQEP/3yLOlARgAEicKCQgAEAAYqp63FxoaCgkIABAAGKHnnBASCQgAEAAYlJqwEBgBIAASZgpkCiBU2pWm+80uY3j0QRo5jGHMi0dC0CAdWflAzJ1kLKmbLhpAWN1ZRc6MRHhTwgCtA1VgIbZRAifO72cjuYgKDirVplUgeXwjVwF8OIJ0oPVdOuCxYkiQ0oYbzy0VKd6WiKVIDQ==",
"metadata": {
"accountToSign": "0.0.34344212",
"returnTransaction": false
}
}
POST/v1/comingsoon
Post Buy Success after Transaction was signed
Coming soon