Giter VIP home page Giter VIP logo

ships-log's Introduction

The OpenSea Ship's Log

A page listing recent auctions and bids on OpenSea, with the ability to buy items on sale right from the page.

Demo

Check out a live version of this example here.

Ship's Log Screenshot

Instructions

Execute nvm use, if you have Node Version Manager, or install Node.js version 8.11 to make sure dependencies work.

Then, to install dependencies:

npm install

To run the app on localhost:

npm start

To minify and create a production build:

npm run build

The Code

This dapp is very simple. Here's the logic for fetching assets with orders:

async fetchData() {
  const { orders, count } = await this.props.seaport.api.getOrders({
    side: this.state.side
    // Other possible query options, with more to come:
    // 'asset_contract_address'
    // 'maker'
    // 'taker'
    // 'owner'
    // 'token_id'
    // 'token_ids'
    // 'sale_kind'
  }, this.state.page)

  this.setState({ orders, total: count })
}

And here's the one-line call for buying an asset:

await this.props.seaport.fulfillOrder({ order: this.props.order, accountAddress })

If you have any questions, drop us a note any time in Discord in the #developers channel!

Deploying to Heroku

The create-react-app buildpack has issues finding dependencies during the build phase. To work around those, you can do npm run eject and deploy a node app, or you can deploy a pure, static site:

heroku create -b https://github.com/heroku/heroku-buildpack-static.git
npm run build
git push heroku master

Directory structure

public houses favicon and base index.html – there should be little reason to use this directory.

src contains the app's js entry point and a simple CSS file

ships-log's People

Contributors

alexanderatallah avatar radotzki 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.