SvgFacet

getAavegotchiSvg

function getAavegotchiSvg(uint256 _tokenId) public view returns (string ag_)

Given an aavegotchi token id, return the combined SVG of its layers and its wearables

Parameters

NameTypeDescription

_tokenId

uint256

the identifier of the token to query

Return Values

NameTypeDescription

ag_

string

The final svg which contains the combined SVG of its layers and its wearables

SvgLayerDetails

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;
}

AavegotchiLayers

struct AavegotchiLayers {
  bytes background;
  bytes bodyWearable;
  bytes hands;
  bytes face;
  bytes eyes;
  bytes head;
  bytes sleeves;
  bytes handLeft;
  bytes handRight;
  bytes pet;
}

previewAavegotchi

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

Parameters

NameTypeDescription

_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

Return Values

NameTypeDescription

ag_

string

The final svg string being generated based on the given test parameters

portalAavegotchisSvg

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

Parameters

NameTypeDescription

_tokenId

uint256

the identifier of the NFT(opened portal)

Return Values

NameTypeDescription

svg_

string[10]

An array containing the svg strings for eeach of the aavegotchis inside the portal //10 in total

getSvg

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

Parameters

NameTypeDescription

_svgType

bytes32

the type of svg

_itemId

uint256

The identifier of the item to query

Return Values

NameTypeDescription

svg_

string

The svg string for the item

getSvgs

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

Parameters

NameTypeDescription

_svgType

bytes32

The type of svg

_itemIds

uint256[]

The identifiers of the items to query

Return Values

NameTypeDescription

svgs_

string[]

An array containing the svg strings for each item queried

getItemSvg

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

Parameters

NameTypeDescription

_itemId

uint256

The identifier of the item to query

Return Values

NameTypeDescription

ag_

string

The svg string for the item

storeSvg

function storeSvg(string _svg, struct LibSvg.SvgTypeAndSizes[] _typesAndSizes) external

Allow an item manager to store a new svg

Parameters

NameTypeDescription

_svg

string

the new svg string

_typesAndSizes

struct LibSvg.SvgTypeAndSizes[]

An array of structs, each struct containing the types and sizes data for _svg

updateSvg

function updateSvg(string _svg, struct LibSvg.SvgTypeAndIdsAndSizes[] _typesAndIdsAndSizes) external

Allow an item manager to update an existing svg

Parameters

NameTypeDescription

_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

deleteLastSvgLayers

function deleteLastSvgLayers(bytes32 _svgType, uint256 _numLayers) external

Allow an item manager to delete the svg layers of an svg

Parameters

NameTypeDescription

_svgType

bytes32

The type of svg

_numLayers

uint256

The number of layers to delete (from the last one)

Sleeve

struct Sleeve {
  uint256 sleeveId;
  uint256 wearableId;
}

setSleeves

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 to

Parameters

NameTypeDescription

_sleeves

struct SvgFacet.Sleeve[]

An array of structs,each struct containing details about the new sleeves of each item `

setItemsDimensions

function setItemsDimensions(uint256[] _itemIds, struct Dimensions[] _dimensions) external

Allow an item manager to set the dimensions of multiple items at once

Parameters

NameTypeDescription

_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

getNextSleeveId

function getNextSleeveId() external view returns (uint256)

used for setting starting id for new sleeve set uploads

Return Values

NameTypeDescription

[0]

uint256

next available sleeve id to start new set upload