ItemsFacet
event TransferToParent(address _toContract, uint256 _toTokenId, uint256 _tokenTypeId, uint256 _value)
event EquipWearables(uint256 _tokenId, uint16[16] _oldWearables, uint16[16] _newWearables)
event UseConsumables(uint256 _tokenId, uint256[] _itemIds, uint256[] _quantities)
struct ItemIdIO {
uint256 itemId;
uint256 balance;
}
function itemBalances(address _account) external view returns (struct ItemsFacet.ItemIdIO[] bals_)
Returns balance for each item that exists for an account
Name | Type | Description |
---|---|---|
_account | address | Address of the account to query |
Name | Type | Description |
---|---|---|
bals_ | struct ItemsFacet.ItemIdIO[] | An array of structs,each struct containing details about each item owned |
function itemBalancesWithTypes(address _owner) external view returns (struct ItemTypeIO[] output_)
Returns balance for each item(and their types) that exists for an account
Name | Type | Description |
---|---|---|
_owner | address | Address of the account to query |
Name | Type | Description |
---|---|---|
output_ | struct ItemTypeIO[] | An array of structs containing details about each item owned(including the item types) |
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
function balanceOfToken(address _tokenContract, uint256 _tokenId, uint256 _id) external view returns (uint256 value)
Get the balance of a non-fungible parent token
Name | Type | Description |
---|---|---|
_tokenContract | address | The contract tracking the parent token |
_tokenId | uint256 | The ID of the parent token |
_id | uint256 | ID of the token |
Name | Type | Description |
---|---|---|
value | uint256 | The balance of the token |
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
Name | Type | Description |
---|---|---|
_tokenContract | address | Contract address for the token to query |
_tokenId | uint256 | Identifier of the token to query |
Name | Type | Description |
---|---|---|
bals_ | struct ItemsFacet.ItemIdIO[] | An array of structs containing details about each item owned |
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
Name | Type | Description |
---|---|---|
_tokenContract | address | Contract address for the token to query |
_tokenId | uint256 | Identifier of the token to query |
Name | Type | Description |
---|---|---|
itemBalancesOfTokenWithTypes_ | struct ItemTypeIO[] | An array of structs containing details about each item owned(including the types) |
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)
function equippedWearables(uint256 _tokenId) external view returns (uint16[16] wearableIds_)
Query the current wearables equipped for an NFT
only valid for claimed aavegotchis
Name | Type | Description |
---|---|---|
_tokenId | uint256 | Identifier of the NFT to query |
Name | Type | Description |
---|---|---|
wearableIds_ | uint16[16] | An array containing the Identifiers of the wearable items currently equipped for the NFT |
function getItemType(uint256 _itemId) public view returns (struct ItemType itemType_)
Query the item type of a particular item
Name | Type | Description |
---|---|---|
_itemId | uint256 | Item to query |
Name | Type | Description |
---|---|---|
itemType_ | struct ItemType | A struct containing details about the item type of an item with identifier _itemId |
function getItemTypes(uint256[] _itemIds) external view returns (struct ItemType[] itemTypes_)
Query the item type of multiple items
Name | Type | Description |
---|---|---|
_itemIds | uint256[] | An array containing the identifiers of items to query |
Name | Type | Description |
---|---|---|
itemTypes_ | struct ItemType[] | An array of structs,each struct containing details about the item type of the corresponding item |
function uri(uint256 _id) external view returns (string)
Get the URI for a voucher type @return URI for token type
function setBaseURI(string _value) external
Set the base url for all voucher types @param _value The new base url
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
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The identifier of the aavegotchi to make changes to |
_wearablesToEquip | uint16[16] | An array containing the identifiers of the wearables to equip |
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
Name | Type | Description |
---|---|---|
_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 |