GithubHelp home page GithubHelp logo

isabella232 / nft-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from decentraland/nft-server

0.0 0.0 0.0 1.1 MB

NFT Server

TypeScript 99.51% Shell 0.03% Dockerfile 0.41% JavaScript 0.05%

nft-server's Introduction

NFT Server

This server is meant to aggregate data from different subgraphs under a single API.

Run the project

npm install

After that you'll need to up check the .env.example file and create your own .env file. Some properties have defaults. Once you're done, you can run the project!

npm start # start the server

npm run start:watch # will watch for changes

Modules

NFTs

Endpoint: /v1/nfts

Type:

type NFT = {
  id: string
  contractAddress: string
  tokenId: string
  activeOrderId: string | null
  owner: string
  name: string
  category: NFTCategory
  image: string
  url: string
  issuedId: string | null
  itemId: string | null
  data: Data
  network: Network
  chainId: ChainId
  createdAt: number
  updatedAt: number
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: newest, name, recently_listed, recently_sold, cheapest.
  • category: Filter by NFTCategory. Possible values: parcel, estate, wearable, ens.
  • owner: Filter by owner. Type: address.
  • isOnSale: Only return results that have an open, non-expired listing. Type: boolean.
  • search: Free text search. Type: string.
  • isLand: Only return results that their category is either parcel or estate.
  • isWearableHead: Only return results that their category is wearable and are part of the avatar's head. Type boolean.
  • isWearableAccessory: Only return results that their category is wearable and accessories (not a part of the body).
  • isWearableSmart: Only return smart wearables. Type boolean.
  • wearableCategory: Filter results by WearableCategory. Possible values: eyebrows,eyes,facial_hair,hair,mouth,upper_body,lower_body,feet,earring,eyewear,hat,helmet,mask,tiara,top_head, skin.
  • wearableGender: Filter results by WearableGender. It supports multiple values by adding the query param multiple times. Possible values: male, female.
  • contractAddress: Filter results by contract address. It supports multiple values by adding the query param multiple times. Type: address.
  • tokenId: Filter results by tokenId. Type: string.
  • itemRarity: Filter results by Rarity. It supports multiple values by adding the query param multiple times. Possible values: unique, mythic, legendary, epic, rare, uncommon, common.
  • itemId: Filter results by itemId. Type string.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

Items

Endpoint: /v1/items

Type:

type Item = {
  id: string
  name: string
  thumbnail: string
  url: string
  category: NFTCategory
  contractAddress: string
  itemId: string
  rarity: Rarity
  price: string
  available: number
  isOnSale: boolean
  creator: string
  data: Data
  network: Network
  chainId: ChainId
  createdAt: number
  updatedAt: number
  reviewedAt: number
  soldAt: number
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: newest, recently_reviewed, recently_sold, name, cheapest.
  • creator: Filter by creator. Type: address.
  • rarity: Filter results by Rarity. It supports multiple values by adding the query param multiple times. Possible values: unique, mythic, legendary, epic, rare, uncommon, common.
  • isSoldOut: Only return results that are sold out (all NFTs have been minted). Type: boolean.
  • isOnSale: Only return results that can be bought (CollectionStore has been added as minter, and there's still available supply to mint). Type: boolean.
  • search: Free text search. Type: string.
  • isWearableHead: Only return results that their category is wearable and are part of the avatar's head. Type boolean.
  • isWearableAccessory: Only return results that their category is wearable and accessories (not a part of the body).
  • isWearableSmart: Only return smart wearables. Type boolean.
  • wearableCategory: Filter results by WearableCategory. Possible values: eyebrows,eyes,facial_hair,hair,mouth,upper_body,lower_body,feet,earring,eyewear,hat,helmet,mask,tiara,top_head, skin.
  • wearableGender: Filter results by WearableGender. It supports multiple values by adding the query param multiple times. Possible values: male, female.
  • emoteCategory: Filter results by EmoteCategory. Possible values: simple,loop.
  • emoteGender: Filter results by WearableGender. It supports multiple values by adding the query param multiple times. Possible values: male, female.
  • contractAddress: Filter results by contract address. Type: address.
  • itemId: Filter results by itemId. Type: string.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

Orders

Endpoint: /v1/orders

Type:

type Order = {
  id: string
  nftId: string
  marketplaceAddress: string
  contractAddress: string
  tokenId: string
  owner: string
  buyer: string | null
  price: string
  status: OrderStatus
  expiresAt: number
  network: Network
  chainId: ChainId
  createdAt: number
  updatedAt: number
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: recently_listed, recently_updated, cheapest.
  • marketplaceAddress: Filter results by marketplace contract address. Type: address.
  • owner: Filter by owner. Type: address.
  • buyer: Filter by buyer. Type: address.
  • contractAddress: Filter results by contract address. Type: address.
  • tokenId: Filter results by tokenId. Type: string.
  • status: Filter results by OrderStatus. Possible values: open, sold, cancelled.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

Bids

Endpoint: /v1/bids

Type:

type Bid = {
  id: string
  bidAddress: string
  bidder: string
  seller: string
  price: string
  fingerprint: string
  status: BidStatus
  blockchainId: string
  blockNumber: string
  expiresAt: number
  contractAddress: string
  tokenId: string
  network: Network
  chainId: ChainId
  createdAt: number
  updatedAt: number
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: recently_offered, recently_updated, most_expensive.
  • bidAddress: Filter results by bid contract address. Type: address.
  • bidder: Filter by bidder. Type: address.
  • seller: Filter by seller. Type: address.
  • contractAddress: Filter results by contract address. Type: address.
  • tokenId: Filter results by tokenId. Type: string.
  • status: Filter results by BidStatus. Possible values: open, sold, cancelled.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

Mints

Endpoint: /v1/mints

Type:

type Mint = {
  id: string
  creator: string
  beneficiary: string
  minter: string
  itemId: string
  tokenId: string
  issuedId: string
  contractAddress: string
  price: string | null
  timestamp: number
  network: Network
  chainId: ChainId
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: recently_minted, most_expensive.
  • creator: Filter by creator. Type: address.
  • beneficiary: Filter by beneficiary. Type: address.
  • minter: Filter by minter. Type: address.
  • contractAddress: Filter results by contract address. Type: address.
  • tokenId: Filter results by tokenId. Type: string.
  • itemId: Filter results by itemId. Type: string.
  • issuedId: Filter results by issuedId. Type: string.
  • isSale: Return only mints that came from a sale.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

Sales

Endpoint: /v1/sales

Type:

export type Sale = {
  id: string
  type: SaleType
  buyer: string
  seller: string
  itemId: string | null
  tokenId: string
  contractAddress: string
  price: string
  timestamp: number
  txHash: string
  network: Network
  chainId: ChainId
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: recently_sold, most_expensive.
  • type: Filter by sale type. Possible values: order, bid, mint.
  • category: Filter by NFT category. Possible values: parcel, estate, ens, wearable.
  • seller: Filter by seller. Type: address.
  • buyer: Filter by buyer. Type: address.
  • contractAddress: Filter results by contract address. Type: address.
  • tokenId: Filter results by tokenId. Type: string.
  • itemId: Filter results by itemId. Type: string.
  • from: Return only sales that happened after this timestamp. Type number.
  • to: Return only sales that happened before this timestamp. Type number.
  • minPrice: Return only sales with a price higher than this. Type number.
  • maxPrice: Return only sales with a price lower than this. Type number.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

Accounts

Endpoint: /v1/accounts

Type:

export type Account = {
  id: string
  address: string
  sales: number
  purchases: number
  spent: string
  earned: string
  royalties: string
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: most_sales, most_purchases, most_spent, most_earned, most_royalties.
  • id: Filter by user address. Type: string.
  • address: Currently the same as id, Filter by user address. Type: 'string'.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

Collections

Endpoint: /v1/collections

Type:

export type Collection = {
  urn: string
  name: string
  creator: string
  contractAddress: string
  isOnSale: boolean
  size: number
  createdAt: number
  updatedAt: number
  reviewedAt: number
  network: Network
  chainId: ChainId
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: newest, name, recently_reviewed, size.
  • name: Filter by the collection name. Type: string.
  • search: Filter collections containing the search value in its name, case insensitive. Type: string.
  • creator: Filter by creator. Type: address.
  • contractAddress: Filter results by contract address. Type: address.
  • isOnSale: Return only collections are currently on sale. Type: boolean.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

Contracts

Endpoint: /v1/contracts

Type:

type Contract = {
  name: string
  address: string
  category: NFTCategory
  network: Network
  chainId: ChainId
}

Query Params:

  • first: Limit the number of results. Type: number.
  • skip: Skip results. Type: number.
  • sortBy: Sort results. Possible values: name.
  • category: Filter by NFTCategory. Possible values: parcel, estate, wearable, ens.
  • network: Filter results by Network. Possible values: ETHEREUM, MATIC.

nft-server's People

Contributors

cazala avatar fzavalia avatar juanmahidalgo avatar lautaropetaccio avatar nachomazzara 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.