Houses

Houses

new Houses(okdk)

Source:

Set up Houses module.

Parameters:
Name Type Description
okdk Object

OKDk module instance.

Methods

createListing(user, houseJSON) → {Promise}

Source:

Create house listing with supplied information.

Handles Swarm upload and transaction to Houses contract.

Parameters:
Name Type Description
user User

User instance of host.

houseJSON Object

JSON object containing house info.

Returns:

newHouseId - Promise that resolves to id of the new house.

Type
Promise

getHouseInfo(id) → {Promise}

Source:

Wrapper for Houses' getHouseInfo method.

Parameters:
Name Type Description
id id

Id of the house to query.

Returns:

houseInfo - Promise that resolves to an JSON object containing info of the house.

Type
Promise

registerHouse(user, bzzHash, gridId) → {Promise}

Source:

Wrapper for Houses' registerHouse method.

Parameters:
Name Type Description
user User

User instance of host.

bzzHash string

Swarm hash of JSON file containing house info.

gridId int

Id within the Earth's grid.

Returns:

newId - Promise that resolves to id of the new house.

Type
Promise

uploadHouseToSwarm(houseJSON) → {Promise}

Source:

Upload house JSON file to Swarm.

Parameters:
Name Type Description
houseJSON Object

JSON object containing house info.

Returns:

bzzHash - Promise that resolves to id of the new house.

Type
Promise