Coder Social home page Coder Social logo

loot.js's Introduction

loot.js

Install

npm install --save loot.js

Get started

var Loot = require('loot.js');

// init
const address = "0x84AB05F09B5ad3a1de6941FBf29BdF77CC7E2100";
let loot = new Loot("http://localhost:8545");

// get OG Loot balance
const ogCount = await loot.numberOfOGBagsInWallet(address);

// get More Loot balance
const moreCount = await loot.numberOfMoreBagsInWallet(address);

// get OG and More Loot balance
const allCount = await loot.numberOfBagsInWallet(address, false);

// get OG and More LootIds
var lootIds = await loot.lootIdsInWallet(address, false);

// ๐Ÿ‘๏ธ Bag #1000 (an OG Loot)
var bag = await loot.bag(1000);
console.log(bag);
/*
{
  id: 1000,
  type: 'Loot',
  chest: 'Holy Chestplate',
  foot: 'Leather Boots',
  hand: 'Leather Gloves',
  head: 'Ancient Helm',
  neck: 'Amulet of Giants',
  ring: 'Platinum Ring',
  waist: 'Demonhide Belt of the Twins',
  weapon: '"Gloom Grasp" Katana of the Twins +1'
}

*/

// ๐Ÿ‘๏ธ Bag #22791 (a More Loot)
var bag = await loot.bag(22791);
console.log(bag);
/*
{
  id: 22791,
  type: 'More Loot',
  chest: '"Gloom Bite" Ring Mail of Perfection +1',
  foot: 'Chain Boots',
  hand: 'Holy Gauntlets of Perfection',
  head: '"Cataclysm Peak" Great Helm of Power +1',
  neck: '"Rage Grasp" Pendant of Protection +1',
  ring: '"Skull Moon" Silver Ring of Skill +1',
  waist: '"Mind Bender" Sash of Enlightenment +1',
  weapon: 'Book'
}
*/

loot.js's People

Contributors

phunk87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

loot.js's Issues

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.