Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W3F M2: Atomic Swaps #294

Merged
merged 59 commits into from
Aug 16, 2024
Merged

W3F M2: Atomic Swaps #294

merged 59 commits into from
Aug 16, 2024

Conversation

vikiival
Copy link
Member

@vikiival vikiival commented Jul 15, 2024

Original PR - w3f/Grants-Program#2271

  • Licensing - MIT License will continue to apply.
  • Documentation - Comprehensive inline code documentation and an explicit README file to guide the project setup and execution.
  • Test Guidelines - Testing will cover major functionality with unit tests and provide a guide for executing these tests.
  • Docker Integration - A Dockerfile will enable the project to run within a Docker container.

Atomic Swaps

  • Atomic Swaps Schema Development - Creating and designing a GraphQL schema entity to represent Atomic Swaps.
  • Atomic Swaps CREATE Handler - Deployment of a handler for indexing creates swap events from the chain.
  • Atomic Swaps CANCEL Event - Implement a handler to index cancel swap events from the chain.
  • Atomic Swaps CLAIM Event - Development of a handler to index claim swap events from the chain.
  • Atomic Swaps with Surcharge Handler - creation of an indexing handler for swap events with a surcharge from the chain.

Offers

  • Offers Schema Development - Creating and designing a GraphQL schema entity to represent Offers.
  • Offers CREATE Handler - Deployment of a handler for indexing creates offer events from the chain.
  • Offers CANCEL Event - Implement a handler to index cancel offer events from the chain.

Token

  • Token Schema Development - Creating and designing a GraphQL schema entity to represent Tokens.
  • Token CRUD Handler - Deployment of a handler handling CREATE, READ, UPDATE, DELETE events from chain

API

  • API Implementation: collectionById - API to fetch collection using its id.
  • API Implementation: collectionListByIssuer - API to fetch collections with a specified address as the issuer (creator).
  • API Implementation: collectionListByName - API to fetch collections containing the specified name.
  • API Implementation: collectionListByOwner - API to fetch collections owned by the specified address.
  • API Implementation: eventList - API that returns all events.
  • API Implementation: eventListByAddress - API that yields events bound to a specified address.
  • API Implementation: eventListByCollectionId - API that generates events for NFTs belonging to the specified collection.
  • API Implementation: eventListByInteraction - API fetching events by specific interaction.
  • API Implementation: eventListByItemId - API that fetches events associated with the specified NFT id.
  • API Implementation: itemById - API that fetches a NFT using its id.
  • API Implementation: itemListByCollectionId - API fetching NFTs from a collection with specified id.
  • API Implement: itemListByCollectionIdAndOwner - API to fetch NFTs from a collection with a specific id and owned by a specified address.
  • API Implement: itemListByCollectionIdList - API to retrieve a list of NFTs from specified collections.
  • API Implementation: itemListByIssuer - API to fetch NFTs where the issuer (creator) is equal to the specified address.
  • API Implementation: itemListByName - API to retrieve NFTs containing the specified name.
  • API Implementation: itemListByMetadataId - API to fetch NFTs with specified metadata uri.
  • API Implement: itemListByMetadataIdMatch - API to fetch NFTs with metadata matching the provided CID.
  • API Implementation: itemListByOwner - API fetching NFTs owned by the specified address.

Implementation

View Queries

Page: Atomic Swap list

  query swapList {
  swaps {
    id
  }
}

Page: Atomic Swap (my swaps)

 query mySwapList($accountId: String!) {
   swaps(where: {caller_eq: $accountId}) {
     id
     nft {
       id
     }
   }
 }

Page: Atomic Swap (incoming swaps)

 query mySwapList($accountId: String!) {
 swaps(where: {desired: { currentOwner_eq: $accountId}}) {
   id
   nft {
     id
   }
 }
}

Page:Atomic swap list by particular collection

  query incomingSwapListByCollectionId($id: String!) {
  swaps(where: {considered: { id_eq: $id}}) {
    id
    nft {
      id
    }
  }
}

Gallery item detail: list swaps intended for the item

query incomingSwapListByItemId($id: String!) {
  swaps(where: {desired: { id_eq: $id}}) {
    id
    nft {
      id
    }
  }
}

Gallery item detail: list swaps matchable for the idem (any from collection)

```graphql
query incomingSwapListByCollectionId($id: String!) {
swaps(where: {considered: { id_eq: $id}}) {
  id
  nft {
    id
  }
}

}


#### Collection details: list swaps intended for a collection

```graphql
  query incomingSwapListByCollectionId($id: String!) {
  swaps(where: {considered: { id_eq: $id}}) {
    id
    nft {
      id
    }
  }
}

Collection detail: list swaps intended from a collection

  query outcomingSwapListByItemId($id: String!) {
  swaps(where: {nft: { collection: {id_eq: $id}} }) {
    id
    nft {
      id
    }
  }
}

Page: Offers list

Page: My Offers

Page: Incoming offers

Gallery item detail: list offers intended for the item

Collection details: list Offers intended for a collection

Collection detail: list offers intended from a collection

Page: Offers / Swap stats

Landing page: top offers/ top swaps?

@roiLeo roiLeo mentioned this pull request Jul 22, 2024
@vikiival vikiival merged commit 8d444ee into main Aug 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant