Links

InstallationFacet

AddedToQueue

event AddedToQueue(uint256 _queueId, uint256 _installationId, uint256 _readyBlock, address _sender)

QueueClaimed

event QueueClaimed(uint256 _queueId)

CraftTimeReduced

event CraftTimeReduced(uint256 _queueId, uint256 _blocksReduced)

UpgradeTimeReduced

event UpgradeTimeReduced(uint256 _queueId, uint256 _realmId, uint256 _coordinateX, uint256 _coordinateY, uint256 _blocksReduced)

InstallationIdIO

struct InstallationIdIO {
uint256 installationId;
uint256 balance;
}

ReservoirStats

struct ReservoirStats {
uint256 spillRate;
uint256 spillRadius;
uint256 capacity;
}

installationsBalances

function installationsBalances(address _account) external view returns (struct InstallationFacet.InstallationIdIO[] bals_)
Returns balance for each installation that exists for an account

Parameters

Name
Type
Description
_account
address
Address of the account to query

Return Values

Name
Type
Description
bals_
struct InstallationFacet.InstallationIdIO[]
An array of structs, each struct containing details about each installation owned

installationsBalancesWithTypes

function installationsBalancesWithTypes(address _owner) external view returns (struct ItemTypeIO[] output_)
Returns balance for each installation(and their types) that exists for an account

Parameters

Name
Type
Description
_owner
address
Address of the account to query

Return Values

Name
Type
Description
output_
struct ItemTypeIO[]
An array of structs containing details about each installation owned(including the installation types)

balanceOfToken

function balanceOfToken(address _tokenContract, uint256 _tokenId, uint256 _id) public view returns (uint256 value)
Get the balance of a non-fungible parent token

Parameters

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

Return Values

Name
Type
Description
value
uint256
The balance of the token

installationBalancesOfToken

function installationBalancesOfToken(address _tokenContract, uint256 _tokenId) public view returns (struct InstallationFacet.InstallationIdIO[] bals_)
Returns the balances for all ERC1155 items for a ERC721 token

Parameters

Name
Type
Description
_tokenContract
address
Contract address for the token to query
_tokenId
uint256
Identifier of the token to query

Return Values

Name
Type
Description
bals_
struct InstallationFacet.InstallationIdIO[]
An array of structs containing details about each item owned

installationBalancesOfTokenWithTypes

function installationBalancesOfTokenWithTypes(address _tokenContract, uint256 _tokenId) external view returns (struct ItemTypeIO[] installationBalancesOfTokenWithTypes_)
Returns the balances for all ERC1155 items for a ERC721 token

Parameters

Name
Type
Description
_tokenContract
address
Contract address for the token to query
_tokenId
uint256
Identifier of the token to query

Return Values

Name
Type
Description
installationBalancesOfTokenWithTypes_
struct ItemTypeIO[]
An array of structs containing details about each installation owned(including installation types)

spilloverRateAndRadiusOfId

function spilloverRateAndRadiusOfId(uint256 _id) external view returns (uint256, uint256)
Check the spillover radius of an installation type

Parameters

Name
Type
Description
_id
uint256
id of the installationType to query

Return Values

Name
Type
Description
[0]
uint256
the spillover rate and radius the installation type with identifier _id
[1]
uint256

installationBalancesOfTokenByIds

function installationBalancesOfTokenByIds(address _tokenContract, uint256 _tokenId, uint256[] _ids) external view returns (uint256[])
Query the installation balances of an ERC721 parent token

Parameters

Name
Type
Description
_tokenContract
address
The token contract of the ERC721 parent token
_tokenId
uint256
The identifier of the ERC721 parent token
_ids
uint256[]
An array containing the ids of the installationTypes to query

Return Values

Name
Type
Description
[0]
uint256[]
An array containing the corresponding balances of the installation types queried

getInstallationType

function getInstallationType(uint256 _installationTypeId) external view returns (struct InstallationType installationType)
Query the item type of a particular installation

Parameters

Name
Type
Description
_installationTypeId
uint256
Item to query

Return Values

Name
Type
Description
installationType
struct InstallationType
A struct containing details about the item type of an item with identifier _itemId

getInstallationUnequipType

function getInstallationUnequipType(uint256 _installationId) external view returns (uint256)

getInstallationTypes

function getInstallationTypes(uint256[] _installationTypeIds) external view returns (struct InstallationType[] installationTypes_)
Query the item type of multiple installation types

Parameters

Name
Type
Description
_installationTypeIds
uint256[]
An array containing the identifiers of items to query

Return Values

Name
Type
Description
installationTypes_
struct InstallationType[]
An array of structs,each struct containing details about the item type of the corresponding item

getCraftQueue

function getCraftQueue(address _owner) external view returns (struct QueueItem[] output_)
Query details about all ongoing craft queues

Parameters

Name
Type
Description
_owner
address
Address to query queue

Return Values

Name
Type
Description
output_
struct QueueItem[]
An array of structs, each representing an ongoing craft queue

getAltarLevel

function getAltarLevel(uint256 _altarId) external view returns (uint256 altarLevel_)

getLodgeLevel

function getLodgeLevel(uint256 _installationId) external view returns (uint256 lodgeLevel_)

getReservoirCapacity

function getReservoirCapacity(uint256 _installationId) external view returns (uint256 capacity_)

getReservoirStats

function getReservoirStats(uint256 _installationId) external view returns (struct InstallationFacet.ReservoirStats reservoirStats_)

BatchCraftInstallationsInput

struct BatchCraftInstallationsInput {
uint16 installationID;
uint16 amount;
uint40 gltr;
}

batchCraftInstallations

function batchCraftInstallations(struct InstallationFacet.BatchCraftInstallationsInput[] _inputs) external

craftInstallations

function craftInstallations(uint16[] _installationTypes, uint40[] _gltr) external
Allow a user to craft installations
Will throw even if one of the installationTypes is deprecated Puts the installation into a queue

Parameters

Name
Type
Description
_installationTypes
uint16[]
An array containing the identifiers of the installationTypes to craft
_gltr
uint40[]
Array of GLTR to spend on each crafting

claimInstallations

function claimInstallations(uint256[] _queueIds) external
Allow a user to claim installations from ready queues
Will throw if the caller is not the queue owner Will throw if one of the queues is not ready

Parameters

Name
Type
Description
_queueIds
uint256[]
An array containing the identifiers of queues to claim

reduceCraftTime

function reduceCraftTime(uint256[] _queueIds, uint40[] _amounts) external
Allow a user to speed up multiple queues(installation craft time) by paying the correct amount of $GLTR tokens
Will throw if the caller is not the queue owner $GLTR tokens are burnt upon usage amount expressed in block numbers

Parameters

Name
Type
Description
_queueIds
uint256[]
An array containing the identifiers of queues to speed up
_amounts
uint40[]
An array containing the corresponding amounts of $GLTR tokens to pay for each queue speedup

equipInstallation

function equipInstallation(address _owner, uint256 _realmId, uint256 _installationId) external
Allow a user to equip an installation to a parcel
Will throw if the caller is not the parcel diamond contract Will also throw if various prerequisites for the installation are not met

Parameters

Name
Type
Description
_owner
address
Owner of the installation to equip
_realmId
uint256
The identifier of the parcel to equip the installation to
_installationId
uint256
Identifier of the installation to equip

unequipInstallation

function unequipInstallation(address _owner, uint256 _realmId, uint256 _installationId) external
Allow a user to unequip an installation from a parcel
Will throw if the caller is not the parcel diamond contract

Parameters

Name
Type
Description
_owner
address
_realmId
uint256
The identifier of the parcel to unequip the installation from
_installationId
uint256
Identifier of the installation to unequip

upgradeComplete

function upgradeComplete(uint256 _queueId) external view returns (bool)