1.0.6 • Published 2 years ago

rarity-analyser v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Rarity analyser

Generates rarity data for an NFT collection.

Fork of rarity-analyser that doesn't use a DB or Filesystem

Usage

Import and then call with the NFT's metadata as the arg

import analyser from 'rarity-analyser'

analyser.analyse(metadata)

Interfaces

Token
interface Token {
  id: number
  name: string
  attributes: Attribute[] // Attribute field name can be configured in rarityConfig.ts
  image?: string
  description?: string
  image_data?: string
  external_url?: string
  animation_url?: string
  background_color?: string

  // The following fields are included in the analysed data
  rarity_score: number
  rank: number
  rarity_score_normalized: number
  rank_normalized: number
}
Attribute
interface Attribute {
  trait_type: number
  value: string

  // The following fields are included in the analysed data
  rarity_score: number
  rarity_score_normalized: number
  percentile: number
  count: number // Count of how many tokens have the value of this attribute
}

TODO

  • Use Github Actions to build & publish package on push
  • Get rid of global config file and make it an arg to the analyse function
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago