SvgFacet
function getAavegotchiSvg(uint256 _tokenId) public view returns (string ag_)
Given an aavegotchi token id, return the combined SVG of its layers and its wearables
Name | Type | Description |
---|---|---|
_tokenId | uint256 | the identifier of the token to query |
Name | Type | Description |
---|---|---|
ag_ | string | The final svg which contains the combined SVG of its layers and its wearables |
struct SvgLayerDetails {
string primaryColor;
string secondaryColor;
string cheekColor;
bytes collateral;
int256 trait;
int256[18] eyeShapeTraitRange;
bytes eyeShape;
string eyeColor;
int256[8] eyeColorTraitRanges;
string[7] eyeColors;
}
struct AavegotchiLayers {
bytes background;
bytes bodyWearable;
bytes hands;
bytes face;
bytes eyes;
bytes head;
bytes sleeves;
bytes handLeft;
bytes handRight;
bytes pet;
}
function previewAavegotchi(uint256 _hauntId, address _collateralType, int16[6] _numericTraits, uint16[16] equippedWearables) external view returns (string ag_)
Allow the preview of an aavegotchi given the haunt id,a set of traits,wearables and collateral type
Name | Type | Description |
---|---|---|
_hauntId | uint256 | Haunt id to use in preview / |
_collateralType | address | The type of collateral to use |
_numericTraits | int16[6] | The numeric traits to use for the aavegotchi |
equippedWearables | uint16[16] | The set of wearables to wear for the aavegotchi |
Name | Type | Description |
---|---|---|
ag_ | string | The final svg string being generated based on the given test parameters |
function portalAavegotchisSvg(uint256 _tokenId) external view returns (string[10] svg_)
Query the svg data for all aavegotchis with the portals as bg (10 in total)
This is only valid for opened and unclaimed portals
Name | Type | Description |
---|---|---|
_tokenId | uint256 | the identifier of the NFT(opened portal) |
Name | Type | Description |
---|---|---|
svg_ | string[10] | An array containing the svg strings for eeach of the aavegotchis inside the portal //10 in total |
function getSvg(bytes32 _svgType, uint256 _itemId) external view returns (string svg_)
Query the svg data for a particular item
Will throw if that item does not exist
Name | Type | Description |
---|---|---|
_svgType | bytes32 | the type of svg |
_itemId | uint256 | The identifier of the item to query |
Name | Type | Description |
---|---|---|
svg_ | string | The svg string for the item |
function getSvgs(bytes32 _svgType, uint256[] _itemIds) external view returns (string[] svgs_)
Query the svg data for a multiple items of the same type
Will throw if one of the items does not exist
Name | Type | Description |
---|---|---|
_svgType | bytes32 | The type of svg |
_itemIds | uint256[] | The identifiers of the items to query |
Name | Type | Description |
---|---|---|
svgs_ | string[] | An array containing the svg strings for each item queried |
function getItemSvg(uint256 _itemId) external view returns (string ag_)
Query the svg data for a particular item (with dimensions)
Will throw if that item does not exist
Name | Type | Description |
---|---|---|
_itemId | uint256 | The identifier of the item to query |
Name | Type | Description |
---|---|---|
ag_ | string | The svg string for the item |
function storeSvg(string _svg, struct LibSvg.SvgTypeAndSizes[] _typesAndSizes) external
Allow an item manager to store a new svg
Name | Type | Description |
---|---|---|
_svg | string | the new svg string |
_typesAndSizes | struct LibSvg.SvgTypeAndSizes[] | An array of structs, each struct containing the types and sizes data for _svg |
function updateSvg(string _svg, struct LibSvg.SvgTypeAndIdsAndSizes[] _typesAndIdsAndSizes) external
Allow an item manager to update an existing svg
Name | Type | Description |
---|---|---|
_svg | string | the new svg string |
_typesAndIdsAndSizes | struct LibSvg.SvgTypeAndIdsAndSizes[] | An array of structs, each struct containing the types,identifier and sizes data for _svg |
function deleteLastSvgLayers(bytes32 _svgType, uint256 _numLayers) external
Allow an item manager to delete the svg layers of an svg
Name | Type | Description |
---|---|---|
_svgType | bytes32 | The type of svg |
_numLayers | uint256 | The number of layers to delete (from the last one) |
struct Sleeve {
uint256 sleeveId;
uint256 wearableId;
}
function setSleeves(struct SvgFacet.Sleeve[] _sleeves) external
Allow an item manager to set the sleeves of multiple items at once
each sleeve in
_sleeves
already contains the _itemId
to apply toName | Type | Description |
---|---|---|
_sleeves | struct SvgFacet.Sleeve[] | An array of structs,each struct containing details about the new sleeves of each item ` |
function setItemsDimensions(uint256[] _itemIds, struct Dimensions[] _dimensions) external
Allow an item manager to set the dimensions of multiple items at once
Name | Type | Description |
---|---|---|
_itemIds | uint256[] | The identifiers of the items whose dimensions are to be set |
_dimensions | struct Dimensions[] | An array of structs,each struct containing details about the new dimensions of each item in _itemIds |
function getNextSleeveId() external view returns (uint256)
used for setting starting id for new sleeve set uploads
Name | Type | Description |
---|---|---|
[0] | uint256 | next available sleeve id to start new set upload |