https://github.com/phunk87/loot.js
loot.js is a library that allow you to interact with loot and more loot contracts.
https://github.com/phunk87/loot.js
loot mloot
Last synced: 16 days ago
JSON representation
loot.js is a library that allow you to interact with loot and more loot contracts.
- Host: GitHub
- URL: https://github.com/phunk87/loot.js
- Owner: Phunk87
- License: mit
- Created: 2021-09-07T03:43:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T18:39:17.000Z (6 months ago)
- Last Synced: 2025-03-26T16:21:16.449Z (about 1 month ago)
- Topics: loot, mloot
- Language: JavaScript
- Homepage: https://lootjs.org
- Size: 15.6 KB
- Stars: 23
- Watchers: 1
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# loot.js
## Install
```Shell
npm install --save loot.js
```## Get started
```javascript
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'
}
*/
```