Post Lore (Blocks)
Post a lore with a signed Message and Lore Object built using Lore blocks
Once you have generated a valid signature or signed Message, it time to post a lore.
Missed how to generate a signed message? Check out the guide below
Posting a lore essentially means Hyype under the hood verifies if the signing wallet owns the token or created the collection contract, and posting with a valid lore type. There can be as many lore types as possible (generally defined at a collection level by specific project teams).
Lore blocks as described in NFT Lore Object Model are fundamental building blocks for lore content. Learn more about different Lore blocks below:
---
After you have caught up on creating and passing lore blocks, let's check the endpoint and the payload structure for the request:
post
https://api.hyy.pe/api/v1
/lore/create-lore
Create Lore
Here is an overview of what goes inside 'lore'
Field Name | Description |
---|---|
type | String. Valid type of lore being sent. e.g. Backstory or Collector Statement |
tokenId | String. Token Id of the NFT e.g. 1003 |
contractAddress | String. contractAddress contains the Smart Contract Address of the specific collection the token belongs to |
loreDetails | Object. loreDetails is the parent object built of multiple compatible lore blocks you will pass while creating a lore |
This is how the object would end up looking like
"lore": {
"type": "Collector Statement",
"tokenId": "228",
"contractAddress": "0xa76ebc37e23bc7f20d62156ad88f2f29bf1e0d3a",
"loreDetails": {
"time": "1652942293417",
"blocks": [{
"id": "bHul0b6BZg",
"type": "paragraph",
"data": {
"text": "this is second lore. test block 1"
}
}, {
"id": "D3hibVAOej",
"type": "paragraph",
"data": {
"text": "test block 2"
}
}, {
"id": "czm8jx2qln",
"type": "paragraph",
"data": {
"text": "test block 3"
}
}],
"version": "2.23.2"
}
}
----
Take a look at how you might want to pass the payload via
curl:
cURL
curl -X 'POST' \
'https://api.hyy.pe/api/v1/lore/create-lore' \
-H 'accept: application/json' \
-H 'client-id: <YOUR_CLIENT_ID_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"signedMessage": "<signed_messages_goes_here>",
"walletAddress": "<signature_owner_address_goes_here>",
"lore": {
"type": "Collector Statement",
"tokenId": "228",
"contractAddress": "0xa76ebc37e23bc7f20d62156ad88f2f29bf1e0d3a",
"loreDetails": {
"time": "1652942293417",
"blocks": [{
"id": "bHul0b6BZg",
"type": "paragraph",
"data": {
"text": "this is second lore. test block 1"
}
}, {
"id": "D3hibVAOej",
"type": "paragraph",
"data": {
"text": "test block 2"
}
}, {
"id": "czm8jx2qln",
"type": "paragraph",
"data": {
"text": "test block 3"
}
}],
"version": "2.23.2"
}
}
}'
Last modified 10mo ago