loot-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

unofficial Loot sdk

Installation

yarn add loot-sdk    # or npm install loot-sdk

Usage

import * as Loot from 'loot-sdk';
// or import individual functions, like:
// import { getBag } from 'loot-sdk';

async function logBagInfo(bagId: number) {
  const bag = await Loot.getBag(bagId);
  console.log(bag);
  /*
    outputs to log:
    {
      "id": 77,
      "chest": "Divine Robe",
      "foot": "Leather Boots",
      "hand": "Heavy Gloves",
      "head": "Leather Cap",
      "neck": "Amulet",
      "ring": "Platinum Ring",
      "waist": "Silk Sash",
      "weapon": "Bone Wand",
      "rarityRank": 6169,
      "currentOwner": {
        "address": "0xf73fe15cfb88ea3c7f301f16ade3c02564aca407",
          "bagsHeld": "1",
          "joined": "1630088328"
      },
      "minted": "2021-08-27T18:18:48.000Z"
    }
  */
}

Functions

// returns a Bag object, containing metadata and information about the current owner
async getBag(bagId: number);

// returns an array of Bag objects with metadata
async getBagsInWallet(address: string);

// returns an array of Transfer objects, including bagIds
async getRecentTransfersForBag(bagId: number);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.21latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.21
0.1.10
0.1.00
0.0.120
0.0.110
0.0.100
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i loot-sdk

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

879 kB

Total Files

13

Last publish

Collaborators

  • shahruz