ItemsFacet

TransferToParent

event TransferToParent(address _toContract, uint256 _toTokenId, uint256 _tokenTypeId, uint256 _value)

EquipWearables

event EquipWearables(uint256 _tokenId, uint16[16] _oldWearables, uint16[16] _newWearables)

UseConsumables

event UseConsumables(uint256 _tokenId, uint256[] _itemIds, uint256[] _quantities)

ItemIdIO

struct ItemIdIO {
  uint256 itemId;
  uint256 balance;
}

itemBalances

function itemBalances(address _account) external view returns (struct ItemsFacet.ItemIdIO[] bals_)

Returns balance for each item that exists for an account

Parameters

NameTypeDescription

_account

address

Address of the account to query

Return Values

NameTypeDescription

bals_

struct ItemsFacet.ItemIdIO[]

An array of structs,each struct containing details about each item owned

itemBalancesWithTypes

function itemBalancesWithTypes(address _owner) external view returns (struct ItemTypeIO[] output_)

Returns balance for each item(and their types) that exists for an account

Parameters

NameTypeDescription

_owner

address

Address of the account to query

Return Values

NameTypeDescription

output_

struct ItemTypeIO[]

An array of structs containing details about each item owned(including the item types)

balanceOf

function balanceOf(address _owner, uint256 _id) external view returns (uint256 bal_)

Get the balance of an account's tokens. @param _owner The address of the token holder @param id ID of the token @return bal The _owner's balance of the token type requested

balanceOfToken

function balanceOfToken(address _tokenContract, uint256 _tokenId, uint256 _id) external view returns (uint256 value)

Get the balance of a non-fungible parent token

Parameters

NameTypeDescription

_tokenContract

address

The contract tracking the parent token

_tokenId

uint256

The ID of the parent token

_id

uint256

ID of the token

Return Values

NameTypeDescription

value

uint256

The balance of the token

itemBalancesOfToken

function itemBalancesOfToken(address _tokenContract, uint256 _tokenId) external view returns (struct ItemsFacet.ItemIdIO[] bals_)

Returns the balances for all ERC1155 items for a ERC721 token

Only valid for claimed aavegotchis

Parameters

NameTypeDescription

_tokenContract

address

Contract address for the token to query

_tokenId

uint256

Identifier of the token to query

Return Values

NameTypeDescription

bals_

struct ItemsFacet.ItemIdIO[]

An array of structs containing details about each item owned

itemBalancesOfTokenWithTypes

function itemBalancesOfTokenWithTypes(address _tokenContract, uint256 _tokenId) external view returns (struct ItemTypeIO[] itemBalancesOfTokenWithTypes_)

Returns the balances for all ERC1155 items for a ERC721 token

Only valid for claimed aavegotchis

Parameters

NameTypeDescription

_tokenContract

address

Contract address for the token to query

_tokenId

uint256

Identifier of the token to query

Return Values

NameTypeDescription

itemBalancesOfTokenWithTypes_

struct ItemTypeIO[]

An array of structs containing details about each item owned(including the types)

balanceOfBatch

function balanceOfBatch(address[] _owners, uint256[] _ids) external view returns (uint256[] bals)

Get the balance of multiple account/token pairs @param _owners The addresses of the token holders @param _ids ID of the tokens @return bals The _owner's balance of the token types requested (i.e. balance for each (owner, id) pair)

equippedWearables

function equippedWearables(uint256 _tokenId) external view returns (uint16[16] wearableIds_)

Query the current wearables equipped for an NFT

only valid for claimed aavegotchis

Parameters

NameTypeDescription

_tokenId

uint256

Identifier of the NFT to query

Return Values

NameTypeDescription

wearableIds_

uint16[16]

An array containing the Identifiers of the wearable items currently equipped for the NFT

getItemType

function getItemType(uint256 _itemId) public view returns (struct ItemType itemType_)

Query the item type of a particular item

Parameters

NameTypeDescription

_itemId

uint256

Item to query

Return Values

NameTypeDescription

itemType_

struct ItemType

A struct containing details about the item type of an item with identifier _itemId

getItemTypes

function getItemTypes(uint256[] _itemIds) external view returns (struct ItemType[] itemTypes_)

Query the item type of multiple items

Parameters

NameTypeDescription

_itemIds

uint256[]

An array containing the identifiers of items to query

Return Values

NameTypeDescription

itemTypes_

struct ItemType[]

An array of structs,each struct containing details about the item type of the corresponding item

uri

function uri(uint256 _id) external view returns (string)

Get the URI for a voucher type @return URI for token type

setBaseURI

function setBaseURI(string _value) external

Set the base url for all voucher types @param _value The new base url

equipWearables

function equipWearables(uint256 _tokenId, uint16[16] _wearablesToEquip) external

Allow the owner of a claimed aavegotchi to equip/unequip wearables to his aavegotchi

Only valid for claimed aavegotchis A zero value will unequip that slot and a non-zero value will equip that slot with the wearable whose identifier is provided A wearable cannot be equipped in the wrong slot

Parameters

NameTypeDescription

_tokenId

uint256

The identifier of the aavegotchi to make changes to

_wearablesToEquip

uint16[16]

An array containing the identifiers of the wearables to equip

useConsumables

function useConsumables(uint256 _tokenId, uint256[] _itemIds, uint256[] _quantities) external

Allow the owner of an NFT to use multiple consumable items for his aavegotchi

Only valid for claimed aavegotchis Consumables can be used to boost kinship/XP of an aavegotchi

Parameters

NameTypeDescription

_tokenId

uint256

Identtifier of aavegotchi to use the consumables on

_itemIds

uint256[]

An array containing the identifiers of the items/consumables to use

_quantities

uint256[]

An array containing the quantity of each consumable to use