Unified Metadata Schemas

PreGod enables developers to swiftly plug in the data returned by its APIs, without worrying about the underlying structure. We take care of all the dirty work to provide the Unified Metadata Schemas (UMS) for all type.

Below you will see a list of types and the corresponding UMS.

📘

This page is still being revised, the UMS listed below may be subject to future changes.

Transaction

All types under the tag transaction (transfer, mint, burn) share the same UMS:

{
    "image": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
    "name": "polygon",
    "symbol": "MATIC",
    "decimals": 18,
    "value": "1234000000000000000",
    "value_display": "1.234", // value_display is the value formatted with the correct number of decimals
    "contract_address": "0x0000000000000000000000000000000000001010",
    "standard": "ERC-20"
}

Exchange

// `withdraw` indicates a token transfer from either a CEX or a DEX. 
// `deposit` indicates a token transfer to either a CEX or a DEX. 
// They both follow the same UMS as `transaction`
{
    "image": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png",
    "name": "polygon",
    "symbol": "MATIC",
    "decimals": 18,
    "value": "1000000000000000000",
    "value_display": "10",
    "contract_address": "0x0000000000000000000000000000000000001010",
    "standard": "ERC-20"
}
// `swap` indicates a token swapping on a DEX.
{
    "protocol": "Uniswap V2",
    "to": {
        "image": "https://s2.coinmarketcap.com/static/img/coins/64x64/825.png",
        "name": "Tether USD",
        "symbol": "USDT",
        "decimals": 6,
        "value": "28652612",
        "value_display": "28.652612",
        "contract_address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
        "standard": "ERC-20"
    },
    "from": {
        "image": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
        "name": "USD Coin",
        "symbol": "USDC",
        "decimals": 6,
        "value": "28622667",
        "value_display": "28.622667",
        "contract_address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
        "standard": "ERC-20"
    }
}
// `liquidity` indicates may indicate many actions, such as:
// 1. `add/remove` tokens to/from a pool
// 2. `supply/borrow` tokens to/from a lender
// 3. `repay` borrowed tokens to a lender
// 4. `collect` yields

{
    "protocol": "Uniswap V2",
    "action": "add", // or `remove`, `supply`, `borrow`, `repay`
    "tokens": [
        {
            "image": "https://s2.coinmarketcap.com/static/img/coins/64x64/825.png",
            "name": "Tether USD",
            "symbol": "USDT",
            "decimals": 6,
            "value": "28652612",
            "value_display": "28.652612",
            "contract_address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
            "standard": "ERC-20"
        },
        {
            "image": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
            "name": "USD Coin",
            "symbol": "USDC",
            "decimals": 6,
            "value": "28622667",
            "value_display": "28.622667",
            "contract_address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
            "standard": "ERC-20"
        }
    ]
}
// `bridge` indicates an aciton of bridging assets from blockchain A to blockchain B.
// action `deposit` refers to depositing tokens into blockchain A's bridge
// action `withdraw` refers to withdrawing tokens from blockchain B's bridge
{
    "token": {
        "name": "Ethereum",
        "image": "https://assets.coingecko.com/coins/images/279/large/ethereum.png",
        "value": "30000000000000000",
        "symbol": "ETH",
        "decimals": 18,
        "standard": "Native",
        "value_display": "0.03"
    },
    "action": "deposit", // it can be `withdraw` as well
    "target_network": {
        "name": "Polygon",
        "symbol": "MATIC",
        "chain_id": 137
    }
}

Collectible

collectible (transfer, mint, burn) share the same UMS:

{
  "id": "3111",
  "value": "1",
  "value_display": "1",
  "contract_address": "0xa6f969045641cf486a747a2688f3a5a6d43cd0d8",
  "standard": "ERC-721",
  "name": "RSS3 Whitepaper v1.0",
  "symbol": "RWP",
  "image": "ipfs://bafybeialcb7udgz56dtpzn7dcchujd5jt6jcu7ugg4y32e2jsvg3z477fq/rss3-whitepaper-no-1.png",
  "attributes": [
    {
      "value": "Natural Selection Labs",
      "trait_type": "Author(s)"
    },
    ...
  ],
  "description": "RSS3 Whitepaper v1.0 - Commemorative & Limited Edition",
  "animation_url": "ipfs://bafybeif2wobpdjlkv7k33k2at4agirvmrs5zqa7hm4wvz72teui6bttg7y/rss3-whitepaper-no-1.glb",
  "external_link": "https://rss3.io/RSS3-Whitepaper.pdf"
}
// `trade` shares the basic structure with `collectible`, but with an additional `cost` field.
{
  "id": "3111",
  "contract_address": "0xa6f969045641cf486a747a2688f3a5a6d43cd0d8",
  "standard": "ERC-721",
  "name": "RSS3 Whitepaper v1.0",
  "value": "1",
  "symbol": "RWP",
  "image": "ipfs://bafybeialcb7udgz56dtpzn7dcchujd5jt6jcu7ugg4y32e2jsvg3z477fq/rss3-whitepaper-no-1.png",
  "attributes": [
    {
      "value": "Natural Selection Labs",
      "trait_type": "Author(s)"
    },
    ...
  ],
  "description": "RSS3 Whitepaper v1.0 - Commemorative & Limited Edition",
  "animation_url": "ipfs://bafybeif2wobpdjlkv7k33k2at4agirvmrs5zqa7hm4wvz72teui6bttg7y/rss3-whitepaper-no-1.glb",
  "external_link": "https://rss3.io/RSS3-Whitepaper.pdf",
  // ths additional fields
  "cost": {
    "name": "Ethereum",
    "image": "https://assets.coingecko.com/coins/images/279/large/ethereum.png",
    "value": "230325000000000000",
    "symbol": "ETH",
    "decimals": 18,
    "value_display": "0.230325000000000000",
    "standard": "Native"
  },
}
// Due to the spamming issue, APIs do not return POAPs by default. We provide two ways to include them:
// 1. Set `include_poap` to true.
// 2. Include `poap` in `type`.
{
    "id": "5364876",
    "name": "RSS3 Cancer Meetup - 2022",
    "image": "https://assets.poap.xyz/rss3-cancer-meetup-2022-2022-logo-1657702983639.png",
    "symbol": "The Proof of Attendance Protocol",
    "standard": "ERC-721",
    "attributes": [
        {
            "value": "07-Jul-2022",
            "trait_type": "endDate"
        },
        {
            "value": "true",
            "trait_type": "virtualEvent"
        },
        {
            "value": "",
            "trait_type": "city"
        },
        {
            "value": "",
            "trait_type": "country"
        },
        {
            "value": "",
            "trait_type": "eventURL"
        },
        {
            "value": "07-Jul-2022",
            "trait_type": "startDate"
        }
    ],
    "description": "The RSS3 2022 Q3 Internal Meeting",
    "contract_address": "0x22c1f6050e56d2876009903609a2cc3fef83b415"
}

Social

// `post` indicates an action of publishing a new post.
// `revise` indicates an action of updating an existing post.
{
    "title": "Guess what's coming",
    "body": "Guess what's coming",
    "author": ["https://lenster.xyz/u/henryqw.lens"],
    "media": [
        {
            "address": "https://ipfs.infura.io/ipfs/QmXGp2tq7yTXMoeKbDqAsFNW9Qw1GGzWbEFiXmhKxVikGj",
            "mime_type": "image/png"
        }
    ],
    "type_on_platform": ["post"]
}
// `comment` indicates an action of commenting on an existing post.
{
    "title": "RSS3 is building a Lens integration!",
    "body": "RSS3 is building a Lens integration!",
    "author": ["https://lenster.xyz/u/henryqw.lens"],
    "media": [
        {
            "address": "https://ipfs.infura.io/ipfs/QmXGp2tq7yTXMoeKbDqAsFNW9Qw1GGzWbEFiXmhKxVikGj",
            "mime_type": "image/png"
        }
    ],
    "type_on_platform": ["comment"],
    "target": {
        "title": "Guess what's coming",
        "body": "Guess what's coming",
        "author": ["https://lenster.xyz/u/henryqw.lens"],
        "created_at": "2022-06-22T16:22:33Z",
        "target_url": "https://lenster.xyz/posts/0x83a6-0x01",
        "media": [
            {
                "address": "https://ipfs.infura.io/ipfs/QmXGp2tq7yTXMoeKbDqAsFNW9Qw1GGzWbEFiXmhKxVikGj",
                "mime_type": "image/png"
            }
        ],
        "type_on_platform": ["post"]
    }
}
// `share` indicates an action of sharing an existing post or comment, think of it as retweet.
{
    "type_on_platform": ["mirror"],
    "target": {
        "body": "Yo! from RSS3! https://rss3.io",
        "author": ["https://lenster.xyz/u/henryqw.lens"],
        // `created_at` and `target_url` of the original post
        "created_at": "2022-06-22T16:22:33Z",
        "target_url": "https://lenster.xyz/posts/0x83a6-0x01"
    }
}

// A `share` may also come with a `comment`, with an identical structure to the `comment` above.
{
    "title": "RSS3 is building a Lens integration!",
    "body": "RSS3 is building a Lens integration!",
    "media": [
        {
            "address": "https://ipfs.infura.io/ipfs/QmXGp2tq7yTXMoeKbDqAsFNW9Qw1GGzWbEFiXmhKxVikGj",
            "mime_type": "image/png"
        }
    ],
    "type_on_platform": ["Mirror"],
    "target": {
        "title": "Guess what's coming",
        "body": "Guess what's coming",
        "media": [
            {
                "address": "https://ipfs.infura.io/ipfs/QmXGp2tq7yTXMoeKbDqAsFNW9Qw1GGzWbEFiXmhKxVikGj",
                "mime_type": "image/png"
            }
        ],
        "type_on_platform": ["Post"]
    }
}
// `profile` indicates an action of creating or updating a new credential.
{
    "address": "0x...",
    "network": "ethereum",
    "platform": "ENS",
    "source": "ENS",
    "name": "henryqw.eth",
    "handle": "henryqw.eth",
    "bio": "The awesome Henry.",
    "expire_at": "2032-01-02T21:28:35Z"
}
// `follow` indicates an action of following an existing profile. `unfollow` uses the same structure.
{
    "type_on_platform": ["Follow"],
    "target": {
        "bio": "",
        "name": "",
        "type": "create",
        "handle": "henryqw.lens",
        "source": "Lens",
        "address": "0x...",
        "network": "polygon",
        "platform": "Lens"
    }
}
// `reward` is an action of supporting authors via a crypto transaction.
{
  "reward": {
    "name": "(PoS) Tether USD",
    "value": "1000000",
    "symbol": "USDT",
    "decimals": 6,
    "standard": "ERC-20",
    "value_display": "1",
    "contract_address": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f"
  },
  "type_on_platform": ["curation"],
  "target": {
    "body": "body",
    "title": "title",
    "author": ["someone"],
    "summary": "summary",
    "type_on_platform": ["post"],
  }
}

Donation

// `launch` indicates an action of launching a new grant.
{
    "logo": "https://c.gitcoin.co/grants/7f2bdd3cbd59dcaaa1c4b54c5b73a952/ethers-gitcoin.png",
    "title": "ethers.js - Complete, Simple and Tiny",
    "platform": "gitcoin",
    "description": "The ethers.js library is a complete and compact library for interacting with the Ethereum Blockchains and their ecosystem..."
}
// `donate` indicates a token transfer to an established grant.
{
    "logo": "https://c.gitcoin.co/grants/7f2bdd3cbd59dcaaa1c4b54c5b73a952/ethers-gitcoin.png",
    "title": "ethers.js - Complete, Simple and Tiny",
    "platform": "gitcoin",
    "description": "The ethers.js library is a complete and compact library for interacting with the Ethereum Blockchains and their ecosystem...",
    // here we have the donation value in detail
    "token": {
        "image": "https://s2.coinmarketcap.com/static/img/coins/64x64/825.png",
        "name": "Tether USD",
        "symbol": "USDT",
        "decimals": 6,
        "value": "10000000",
        "value_display": "10",
        "contract_address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
        "standard": "ERC-20"
    }
}

Governance

// `propose` indicates an action of creating a new proposal.
{
    "type_on_platform": ["proposal"],
    "id": "123",
    "title": "some agenda",
    "body": " description of the proposal",
    "options": ["1. yea", "2. neh", "3. abstain"],
    "startAt": "2022-01-01T15:00:00Z",
    "endAt": "2022-01-02T15:00:00Z",
    "organization": {
      "type_on_platform": ["charity"],
      "id": "8818",
      "name": "some charity",
      "about": " description of the organization"
    }
}
// `vote` indicates a voting action on an established proposal.
{
    "type_on_platform": ["vote"],
    "choice": "1",
    "proposal": {
        "type_on_platform": ["proposal"],
        "id": "123",
        "title": "some agenda",
        "body": " description of the proposal",
        "options": ["1. yea", "2. neh", "3. abstain"],
        "startAt": "2022-01-01T15:00:00Z",
        "endAt": "2022-01-02T15:00:00Z",
        "organization": {
          "type_on_platform": ["charity"],
          "id": "8818",
          "name": "some charity",
          "about": " description of the organization"
        }
    }
}