merkle-badges

1.0.4 • Public • Published

badgeth-merkle-module

Get a merkle tree of badgeAwards from a Badgeth compatible subgraph

import { fetchBadgesAndGenerateTree } from 'merkle-badges'

const GQL_ENDPOINT = "https://api.studio.thegraph.com/query/0000"
const GQL_QUERY = gql`
  {
    badgeAwards(first: 64, orderBy: globalBadgeNumber, where: {definition: "Captain Subgraph"}) {
      globalBadgeNumber
      winner {
        id
      }
      definition {
        id
      }
    }
  }
`
const mTree = await indexPkg.fetchBadgesAndGenerateTree(
  GQL_QUERY, 
  GQL_ENDPOINT
);

Readme

Keywords

none

Package Sidebar

Install

npm i merkle-badges

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

3.04 kB

Total Files

6

Last publish

Collaborators

  • hardforksoverknives