Fields.js Documentation
Functions
- updateName(address, newName) ⇒
openField(address) Updates the name of a vineyard
- changeStatus(address) ⇒
Changes the status of the vineyard
- loadSingleField(address, [bottle]) ⇒
loadSingleFieldCard(json) Loads a single field card
- getFieldCards()
Adds a single Fieldcard to the page
- getAllFields() ⇒
fields Creates an array of the field JSON files
- getHarvestableFields() ⇒
dropdown Fetches all fields that are harvestable as dropdown options for the harvest
- loadSingleFieldCard(json) ⇒
fieldcard Loads a single Field as card object
- checkHarvestable(address) ⇒
Checks if a vineyard is harvestable
- fieldAsJson(address) ⇒
json Builds a JSON file with data from the vineyard
- getGrapeType(field_instance) ⇒
type Fetches the Grape type from the contract
- getTransactionsSinceHarvest(address) ⇒
json Gets all transactions since the previous harvest
- newField()
Creates a new Field contract
- openField(address) ⇒
field Opends the Details Modal and loads a single field
- addFieldTransaction(address)
Adds a transaction to the contract
- getTotalTransactionCount(address) ⇒
Gets the total amount of transactions to this contract
- getTransactionSenderAtIndex(address, index) ⇒
sender Gets a specific transaction sender with an index
- getTransactionDataAtIndex(address, index) ⇒
data Gets the data of a transaction with an index
- getTransactionTimeAtIndex(address, index) ⇒
time Gets the timestamp of a transaction
- getAllTransactions(address) ⇒
json Gets all transactions made to this contract
updateName(address, newName) ⇒ openField(address)
Updates the name of a vineyard
Kind: global function
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the field contract |
| newName | \* |
The new name |
changeStatus(address) ⇒
Changes the status of the vineyard
Kind: global function Returns: boolean
| Param | Type | Description |
|---|---|---|
| address | \* |
Contract address of the field |
loadSingleField(address, [bottle]) ⇒ loadSingleFieldCard(json)
Loads a single field card
Kind: global function
| Param | Type | Default | Description |
|---|---|---|---|
| address | \* |
Address of the field contract | |
| [bottle] | boolean |
false |
getFieldCards()
Adds a single Fieldcard to the page
getAllFields() ⇒ fields
Creates an array of the field JSON files
Kind: global function
Returns: fields - Array of JSON
getHarvestableFields() ⇒ dropdown
Fetches all fields that are harvestable as dropdown options for the harvest
Kind: global function
Returns: dropdown - Dropdown of the fields
loadSingleFieldCard(json) ⇒ fieldcard
Loads a single Field as card object
Kind: global function
| Param | Type | Description |
|---|---|---|
| json | \* |
JSON data to add to the template |
checkHarvestable(address) ⇒
Checks if a vineyard is harvestable
Kind: global function Returns: boolean
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the field contract |
fieldAsJson(address) ⇒ json
Builds a JSON file with data from the vineyard
Kind: global function
Returns: json - JSON data
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the contract |
getGrapeType(field_instance) ⇒ type
Fetches the Grape type from the contract
Kind: global function
Returns: type - Grape Type as String
| Param | Type | Description |
|---|---|---|
| field_instance | \* |
Contract instance |
getTransactionsSinceHarvest(address) ⇒ json
Gets all transactions since the previous harvest
Kind: global function
Returns: json - JSON of the transactions
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the field contract |
newField()
Creates a new Field contract
openField(address) ⇒ field
Opends the Details Modal and loads a single field
Kind: global function
Returns: field - JSON of the field data
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the field to load |
addFieldTransaction(address)
Adds a transaction to the contract
Kind: global function
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the contract |
getTotalTransactionCount(address) ⇒
Gets the total amount of transactions to this contract
Kind: global function Returns: Integer value of the total transactions
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the contract |
getTransactionSenderAtIndex(address, index) ⇒ sender
Gets a specific transaction sender with an index
Kind: global function
Returns: sender - Address of the sender
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the contract |
| index | \* |
Integer value as index |
getTransactionDataAtIndex(address, index) ⇒ data
Gets the data of a transaction with an index
Kind: global function
Returns: data - String of the data
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the contract |
| index | \* |
Integer value as index |
getTransactionTimeAtIndex(address, index) ⇒ time
Gets the timestamp of a transaction
Kind: global function
Returns: time - Readable timestamp
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the contract |
| index | \* |
Integer value as index |
getAllTransactions(address) ⇒ json
Gets all transactions made to this contract
Kind: global function
Returns: json - Json file with all transactions
| Param | Type | Description |
|---|---|---|
| address | \* |
Address of the contract |