GithubHelp home page GithubHelp logo

joseroque / atlas-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from decentraland/atlas-server

0.0 1.0 0.0 1.42 MB

๐Ÿ—บ A server for the atlas map

Shell 0.06% TypeScript 99.25% Dockerfile 0.69%

atlas-server's Introduction

atlas-server

๐Ÿ—บ A server for the atlas map

Setup

  1. Run npm install
  2. Run npm run build
  3. Run npm start

Config

The env variables and their default values are the following:

PORT=5000
HOST=0.0.0.0
API_URL=https://api.thegraph.com/subgraphs/name/decentraland/marketplace
API_BATCH_SIZE=1000
API_CONCURRENCY=10
REFRESH_INTERVAL=60

You can cp .env.example .env and tweak the ones you want to change

Endpoints

Tiles

  • /v1/tiles: Returns all the tiles in the map, with the legacy format:
{
  type: number
  x: number
  y: number
  owner?: string
  estate_id?: string
  name?: string
  top?: number
  left?: number
  topLeft?: number
  price?: number
}

This endpoint has been deprecated, you should use the /v2/tiles endpoint, more info below.

  • /v2/tiles: Returns all the tiles in the map, with the following format:
{
  id: string
  x: number
  y: number
  type: 'owned' | 'unowned' | 'plaza' | 'road' | 'district'
  top: boolean
  left: boolean
  topLeft: boolean
  updatedAt: number
  name?: string
  owner?: string
  estateId?: string
  tokenId?: string
  price?: number
}

Filter: You can filter the results and the payloads using the following query params:

  • x1,y1,x2,y2: You can request just a piece of the map, for example this will only return tiles between 10,10 and 20,20:
/v2/tiles?x1=10&y1=10&x2=20&y2=20
  • include: You can select which fields to include in each tile, for example this would include only type, top, left and topLeft:
/v2/tiles?include=type,top,left,topLeft
  • exclude: The opposite to the filter above, the fields you pass in this filter will be excluded from each tile, for example if you don't cate about the updatedAt and tokenId fields you can do:
/v2/tiles?exclude=updatedAt,tokenId

Map

  • /v1/map.png: This endpoint returns a PNG of the genesis map. You can customize the following via query params:

    • width: The width in pixels of the image, ie: ?width=1024

    • height: The height in pixels of the image, ie: ?height=1024

    • size: The size in pixels of each tile, for instance if size is 10, all the tiles will be 10x10px, ie: ?size=10

    • center: The coords on which to center the map, ie: ?center=20,20

    • selected: A list of coords to be highlighted, separated with semicolons, ie: ?selected=10,10;10,11;11,10;11,11

    • on-sale: If true, the parcels and estates on sale will be displayed in blue.

Example:

/v1/map.png?center=23,-23&selected=23,-23&size=20&width=2048&height=2048

example

  • /v1/parcels/:x/:y/map.png: This endpoint returns a PNG of the map already centered and highlighting a Parcel. You can also adjust width, height and size via query params

  • /v1/estates/:id/map.png: This endpoint returns a PNG of the map already centered and highlighting an Estate. You can also adjust width, height and size via query params

  • /v2/parcels/:x/:y: This endpoint returns metadata about a parcel by passing its coordinates. The metadata uses the OpenSea Metadata Standard.

  • /v2/estates/:id: This endpoint returns metadata about an estate by passing its id. The metadata uses the OpenSea Metadata Standard.

  • /v2/contracts/:address/tokens/:id: This endpoint returns metadata about a parcel or an estate, by passing the contract address and the token id. The contract address for LAND on mainnet is 0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d and the contract address for Estate on mainnet is 0x959e104e1a4db6317fa58f8295f586e1a978c297. The metadata uses the OpenSea Metadata Standard.

  • /v2/districts: Returns a list of all Districts in Genesis City.

  • /v2/districts/:id: Returns a specific district by id.

  • /v2/addresses/:address/contributions: Returns a list of contributions made by specific address. Each contribution includes the amount of parcels and the district id they were contributed to.

atlas-server's People

Contributors

cazala avatar nachomazzara avatar menduz avatar 2fd avatar

Watchers

James Cloos 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.