Coder Social home page Coder Social logo

kyst's Introduction

Kyst: Simple Cryptokitties API Wrapper for NodeJS

Description

This is a simplistic API wrapper for Cryptokitties. There is one class KystClient with basic methods to get basic information.

src/example.js has a simplistic usage of it listing links of cryptokitties whose current price is less than the calculated median.

Install:

npm install kyst
yarn add kyst

Running Example:

This assumes you know nothing about programming.

Steps:

  1. Install NodeJS.
  2. Install git.
  3. Open your command prompt by typing cmd in the search bar for Windows or Spotlight search terminal for OSX.
  4. Type node -v and git --version. You should see their respective version numbers.
  5. Navigate to some place where you want to store this repository via cd <directory> If you are in Windows, run dir to see a list of directories. If you are on OSX, run lsto see a list of directories.
  6. Run the following git clone https://github.com/lamdaV/kyst.git. This clones the repository files to the current directory you are in.
  7. Move into the directory by running cd kyst.
  8. Run npm install to download dependencies.
  9. Run node dist/example.js. This will try to find 10 cryptokitties with a current price that is less than the median price and with a generation of less than or equal to 8. This will print out the links to each cryptokitties when done.
  10. If you want to change the number of cryptokitties to find, go into src/example.js and find this
findNKitties(10) // <--- Change 10 to whatever you want.
  .then((matchedUrls) => {
    console.log("\nFound Kitties: ");
    matchedUrls.forEach((matchedUrl) => console.log(matchedUrl))
  });
  1. Run npm run buildall. This rebuilds all the files. Then, run node dist/example.js.

Contribute:

Feel free to contribute. Fork the repository, make your changes, make a pull request with details of changes, and tag me in it.

Docs:

NOTE All KystClient methods return a Promise.

KystClient.getAuctions(offset, limit, type, status)

Gets a list of Auction data from Cryptokitties.

Params:
  • offset - integer of Cryptokitties to skip by
  • limit - integer of Cryptokitties to return between 1 and 100
  • type - an element of the set { "sales", "sire" }
  • status - an element of the set { "open", "closed" }

KystClient.getKitty(kittyId)

Gets a Cryptokitties info.

Params:
  • kittyId - integer of the Cryptokittie's identifier

KystClient.getUser(userAddress)

Params:
  • userAddress - string of the hex address of the Cryptokittie user

KystClient.getMetaData()

Gets Meta Data from nieldlr cryptokitties dashboard

KystClient.getAveragePriceUSD()

Facade to get the average price in USD from the nieldlr cryptokitties dashboard.

KystClient.getMedianPriceUSD()

Facade to get the median price in USD from the nieldlr cryptokitties dashboard.

KystClient.convertUSD2ETH(usd)

Helper method to convert USD to ETH.

Params:
  • usd - number of the USD value to convert

KystClient.getCAttributes()

Gets an Object of existing cattributes and their corresponding count from cryptokittydex.

Dependencies:

kyst's People

Contributors

lamdav avatar

Watchers

 avatar  avatar

Forkers

thosuperman

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.