GithubHelp home page GithubHelp logo

onigiri-x / punkpairs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itsjerryokolo/cryptopunks

0.0 0.0 0.0 1.4 MB

Subgraph for the Cryptopunks marketplace

Home Page: https://thegraph.com/explorer/subgraph?id=YqMJatbgbqy1GodtbYZv4U9NzyaScCgSF7CAE5ivAM7&view=Overview

TypeScript 94.79% Solidity 5.21%

punkpairs's Introduction

CryptoPunks

The CryptoPunks are 10,000 uniquely generated characters. No two are exactly alike, and each one of them can be officially owned by a single person on the Ethereum blockchain.

Punks

Subgraph url

https://thegraph.com/explorer/subgraph?id=YqMJatbgbqy1GodtbYZv4U9NzyaScCgSF7CAE5ivAM7&view=Overview

GraphQL endpoint

Query the subgraph via its endpoint

https://gateway.thegraph.com/api/[api-key]/subgraphs/id/YqMJatbgbqy1GodtbYZv4U9NzyaScCgSF7CAE5ivAM7

Entities

You'll find the description of the various fields in the schema.graphql

  • ASK: This entity captures the ASKS for a punk or from a user. It also shows the current ASK of the Punk. An ask can be open or closed. You can also query when the ask was created and when it was removed
  • BID: This entity captures the BIDS for a punk or from a user. It also shows the current BID of the Punk. An ask can be open or closed. You can also query when the bid was created and when it was removed
  • PUNK: This entity holds useful information about the Punks; traits, accessories, gender, owner etc
  • ACCOUNT: Account contains the user data; Trades, Hodlings etc
  • CONTRACT: Contract metadata including Trade Volume
  • METADATA: Here, you can retrieve the punk tokenURI, image URI, traits, and other useful metadata
  • SALE - Query punk sale events

Queries

A list of example queries you can make can be found here: Queries.md

Available Enums for Punk

  • male
  • female
  • zombie
  • alien
  • ape

Run your local Graph Node

ETHEREUM_RPC=mainnet:https://eth-mainnet.alchemyapi.io/v2/${YOUR_API_KEY} docker compose up

Logic for Transfers/Wraps

  • Regular PunkTransfer
    • In handlePunkTransfer:
      • decrement from
      • increment to
      • set owner
      • create Transfer event
  • Mint/Wrap
    • In handlePunkTransfer (to = WrappedPunkAddress):
      • decrement from
      • In handleWrappedPunkTransfer (from = ZeroAddress):
      • increment to
      • set owner
      • create Wrap event
  • Burn/Unwrap
    • In handlePunkTransfer (from = WrappedPunkAddress):
      • increment to
      • set owner
    • In handleWrappedPunkTransfer (to = ZeroAddress):
      • decrement from
      • create Unwrap event
  • Wrapped Transfer
    • In handleWrappedPunkTransfer:
      • decrement from
      • increment to
      • set owner
      • create Transfer event

punkpairs's People

Contributors

itsjerryokolo avatar schmidsi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.