Skip to content

Commit

Permalink
🧪 proof_of_chaos metadata
Browse files Browse the repository at this point in the history
vikiival committed Oct 19, 2023
1 parent a803a3f commit c09c8eb
Showing 2 changed files with 51 additions and 1 deletion.
20 changes: 19 additions & 1 deletion hyperdata/tests/content.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { describe, expect, it } from 'vitest'
import { OpenSeaMetadata, TezosMetadata, contentFrom } from '../src'
import { OpenSeaMetadata, TezosMetadata, contentFrom, attributeFrom } from '../src'
import fxhash from './examples/fxhash.json'
import koda from './examples/koda.json'
import poc from './examples/proof-of-chaos.json'

describe('contentFrom', () => {
it(`should parse FXhash metadata to Content correctly`, () => {
@@ -53,4 +54,21 @@ describe('contentFrom', () => {
type: '',
})
})

it(`should parse Proof of Chaos metadata to Content correctly`, () => {
const metadata = poc as OpenSeaMetadata
expect(contentFrom(metadata)).toStrictEqual({
_raw: undefined,
name: metadata.name,
description: metadata.description,
image: metadata.image,
animationUrl: metadata.animation_url,
attributes: metadata.attributes?.map(attributeFrom) || [],
externalUrl: metadata.external_url,
generative: undefined,
tags: [],
thumbnail: undefined,
type: 'video/mp4',
})
})
})
32 changes: 32 additions & 0 deletions hyperdata/tests/examples/proof-of-chaos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"external_url": "https://www.proofofchaos.app/",
"mediaUri": "ipfs://ipfs/QmcfALNaGnYzujGiPWL2Q2PPBC7nBhr8JnT4bxFkFBH7gT",
"image": "ipfs://ipfs/Qmf1pn8Zsjk3NdgeVPufmRW68sMQH4MR5DqeSZ9UnqwD89",
"type": "video/mp4",
"animation_url": "ipfs://ipfs/QmcfALNaGnYzujGiPWL2Q2PPBC7nBhr8JnT4bxFkFBH7gT",
"name": "deef - afterlife review of moments in love - [epic]",
"description": "Herein lies the epic culmination, concealed yet not forgotten, in the form of 'deef - Afterlife Review of Moments in Love', the clandestine audiovisual finale from the forthcomming chronicles known as 'Love Loops Explorer' (2023/2024).\n\n[https://deef.xyz/](https://deef.xyz/)\n\n_This NFT was created with [proofofchaos.app](https://proofofchaos.app/referendum-rewards)_",
"attributes": [
{ "trait_type": "rarity", "value": "epic" },
{
"trait_type": "name",
"value": "deef - afterlife review of moments in love - [epic]"
},
{
"trait_type": "description",
"value": "Herein lies the epic culmination, concealed yet not forgotten, in the form of 'deef - Afterlife Review of Moments in Love', the clandestine audiovisual finale from the forthcomming chronicles known as 'Love Loops Explorer' (2023/2024)."
},
{ "trait_type": "artist", "value": "deef" },
{ "trait_type": "referendum", "value": 99 },
{
"trait_type": "recipient",
"value": [
["HAPBZTbxZd4gtptAZwU3XjbFs2d1FnQ6sKd7W8FAAsJmKCw", 80],
["Go8NpTvzdpfpK1rprXW1tE4TFTHtd2NDJCqZLw5V77GR8r4", 20]
]
},
{ "trait_type": "totalSupply", "value": 427 },
{ "trait_type": "totalSupplyRarity", "value": 33 },
{ "trait_type": "royalty", "value": 30 }
]
}

0 comments on commit c09c8eb

Please sign in to comment.