1.0.0-6 • Published 2 years ago

@candoizo/aavegotchi-leaderboard v1.0.0-6

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

aavegotchi-leaderboard

aavegotchi rarity farming leaderboard

usage

import { leaderboard } from '@candoizo/aavegotchi-leaderboard';

there is also a cli:

npx @candoizo/aavegotchi-leaderboard --help

Functions

setData(index) ⇒

Get set information by index in the list of sets.

Kind: global function
Returns: The current set data at the given index.

ParamTypeDescription
indexnumberThe index of the set in the list, starting at 0

isSetItemsInEquippedWearables(setItems, equippedWearables) ⇒ boolean

Checks whether the setItems is a subset of the equippedWearables

Kind: global function
Returns: boolean - True if the equippedWearables match the setItems

ParamTypeDescription
setItemsArray.<number>Set to check the first array is a subset of the second array
equippedWearablesArray.<number>Set to check the first array is a subset of the second array

allSetsForItems(items) ⇒ Array.<number>

This function will return all of the sets that a player has equipped based on the items they have equipped

Kind: global function
Returns: Array.<number> - An array of all the set by index that the player has equipped

ParamTypeDescription
itemsArray.<number>An array of all the item ids that the player has equipped

allSetsForAavegotchi(aavegotchi) ⇒ Array.<number>

This function will return all of the sets that an Aavegotchi has equipped based on the items they have equipped and collateral

Kind: global function
Returns: Array.<number> - An array of all the set by index that the player has equipped

ParamTypeDescription
aavegotchiSubgraphResultObject representing an Aavegotchi subgraph result with equippedWearables and collateral properties

bestSetOfSets(sets) ⇒ number

Takes an array of set indices and returns the index of the set with the best bonuses

Kind: global function
Returns: number - The index of the set with the best bonuses

ParamTypeDescription
setsArray.<number>An array of set indices

returnRarity(number) ⇒ number

This function returns the rarity bonus of a number given.

Kind: global function
Returns: number - The rarity of the given number.

ParamTypeDescription
numbernumberA number between 1 and 100.

rarityScoreBonus(traits) ⇒ number

Takes an array of trait values and returns the total rarity score bonus.

Kind: global function
Returns: number - The total rarity score bonus.

ParamTypeDescription
traitsArray.<number>An array of trait values.

kinshipMinusLastInteracted(kinship, lastInteracted) ⇒ number

Get the on-chain kinship using sui the current kinship and last interaction timestamp to calculate kinship, to get accurate value from subgraph Aavegotchis

Kind: global function
Returns: number - A kinship score. https://github.com/aavegotchi/aavegotchi-contracts/blob/847e437bf31a746b520c1b506adef7788716e797/contracts/Aavegotchi/libraries/LibAavegotchi.sol#L223

ParamTypeDescription
kinshipnumberA kinship value.
lastInteractednumberA timestamp of the last interaction.

seasonRoundBlockSnapshots(season, round) ⇒ number | undefined

Get the block snapshots for the given season and round.

Kind: global function
Returns: number | undefined - A canonical snapshot block number for the given season and round. 0/undefined if not set.

ParamTypeDescription
seasonnumberThe season number
roundnumberThe round number

aavegotchis(blockNumber) ⇒ Promise.<Object>

Fetch all Aavegotchi information from subgraph

Kind: global function
Returns: Promise.<Object> - Returns data in a promise

ParamTypeDescription
blockNumbernumberThe number of the block to query

leaderboard(round, season, blockNumber, exportRange) ⇒ Promise.<Object>

Returns the leaderboard for a given round

Kind: global function
Returns: Promise.<Object> - An object containing the leaderboard results

ParamTypeDescription
roundnumberThe round for which to return the leaderboard
seasonnumberThe season for which to return the leaderboard
blockNumbernumberThe block number for which to return the leaderboard
exportRangenumberThe amount of results to return