AddTask
This task will add a numerical input by a scalar value from a job of subtasks, an aggregator, or a big.
Input: The current running numerical result output from a scalar value, an aggregator, a job of subtasks or a big.
Returns: A numerical result.
Example: Returns the numerical result by adding by a job of subtasks.
{
"tasks": [
{
"valueTask": {
"value": 100
}
},
{
"addTask": {
"job": {
"tasks": [
{
"valueTask": {
"value": 10
}
}
]
}
}
}
]
}
Example: Returns the numerical result by multiplying by an aggregator.
{
"tasks": [
{
"valueTask": {
"value": 100
}
},
{
"addTask": {
"aggregatorPubkey": "GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR"
}
}
]
}
Example: Returns the numerical result by multiplying by a big.
{
"tasks": [
{
"cacheTask": {
"cacheItems": [
{
"variableName": "TEN",
"job": {
"tasks": [
{
"valueTask": {
"value": 10
}
}
]
}
}
]
}
},
{
"valueTask": {
"value": 100
}
},
{
"addTask": {
"big": "${TEN}"
}
}
]
}
Fields
Name | Type | Description |
---|---|---|
aggregatorPubkey | string | Specifies an aggregator to add by. |
big | string | A stringified big.js. |
job | A job whose result is computed before adding our numerical input by that result. | |
scalar | double | Specifies a scalar to add by. |