Network-Goods / hypercerts-sdk

2 stars 0 forks source link

Update validors and parsers to updated JSON schema #29

Open bitbeckers opened 1 year ago

bitbeckers commented 1 year ago
          Alright! I think we finally have it!

This is what it looks like on OpenSea: https://testnets.opensea.io/assets/goerli/0xffb1fbff7a40ea441aeae8036812af116f593995/57

Updates:

{
    "name": "Example Hypercert",
    "description": "This is where the description of the hypercert will go.",
    "external_url": "https://hypercerts.xyz",
    "image": "ipfs://bafybeifs7abhcooeelyjxmnlrcd5kuupfl5czhtyub2imzxzccrhzz3bem",
    "version": "1.0.0",
    "properties": [
        {
            "trait_type": "Example Property 1", 
            "value": "Some text here"
        },
        {
            "trait_type": "Example Property 2", 
            "value": "More text here"
        }
    ],
    "hypercert": {
        "impact_scope": {
            "name": "Impact Scope",
            "value": ["all"],
            "display_value": "All"
        },
        "work_scope": {
            "name": "Work Scope",
            "value": ["art design", "metadata standards"],
            "display_value": "Art Design & Metadata Standards"
        },
        "work_timeframe": {
            "name": "Work Timeframe",
            "value": [1663819200, 1673163072],
            "display_value": "2022-09-22 \u2192 2023-01-08"
        },
        "impact_timeframe": {
            "name": "Impact Timeframe",
            "value": [1673163072, 0],
            "display_value": "2023-01-08 \u2192 Indefinite"
        },
        "contributors": {
            "name": "Contributors",
            "value": ["0x799B774204A348E1182fE01074C51444bA70A149"],
            "display_value": "0x799...149"
        },
        "rights": {
            "name": "Rights",
            "value": ["public display", "-transfers"],
            "display_value": "Public display"
        }
    }
}

Originally posted by @ccerv1 in https://github.com/Network-Goods/hypercerts/issues/98#issuecomment-1407193885

Jipperism commented 1 year ago

@bitbeckers @ryscheng working on this now. Wondering whether we want to provide a formatting utility to the end user as well, as this schema would be pretty cumbersome to format to everytime. We can then format it, and also run validation against the JSON schema in the same function?

Jipperism commented 1 year ago

It would also help with making sure display_value properties etc are formatted consistently.

ccerv1 commented 1 year ago

Wondering whether we want to provide a formatting utility to the end user as well, as this schema would be pretty cumbersome to format to everytime. It would also help with making sure display_value properties etc are formatted consistently.

@Jipperism agreed. I created a utility in python for rendering (see here) that could be adapted for this purpose

Jipperism commented 1 year ago

Wondering whether we want to provide a formatting utility to the end user as well, as this schema would be pretty cumbersome to format to everytime. It would also help with making sure display_value properties etc are formatted consistently.

@Jipperism agreed. I created a utility in python for rendering (see here) that could be adapted for this purpose

Already created my own in the SDK. It might have to be updated once people settle on either "Workscope A & Workscope B" or Workscope A ^ Workscope B" for example.

Jipperism commented 1 year ago

https://github.com/Network-Goods/hypercerts/issues/98 linking this here

ccerv1 commented 1 year ago

@Jipperism:

Already created my own in the SDK. It might have to be updated once people settle on either "Workscope A & Workscope B" or Workscope A ^ Workscope B" for example.

Agreed. Happy to let @holkeb decide

holkexyz commented 1 year ago

yes, let's use  "workscope A ∧ workscope B"

(note that it's not ^ but ∧)