solui
  • Dapps
  • Getting Started
  • Docs
  • Community

Outputs

Outputs specify results to display to the user once panel has succesfully executed. If no outputs are defined then the Dapp will not display any results but will simply show a success status.

Outputs

Structure

{
  ...,
  "panels": [
    {
      ...,
      "outputs": [
        {
          "title": "...",
          "type": "...",
          "value": "...",
          "transform": [ ... ]
        },
        ...
      ]
    }
  ]
}

Note that outputs are only displayed once all Execution steps have been completed.

Reference

type

The output type. This is to help the renderer figure out how best to display the output value. At present this must be one of:

  • address
  • bool
  • bytes32
  • int
  • string
  • address[]
  • bytes32[]
  • int[]

Example:

{
  "type": "string"
}

If you specify an array type (i.e. with the [] suffix) then the each value within the returned list will be rendered one after another, and the other output formatting options will be applied to each and every value in turn:

Array output

Also, if you are applying transformations then the type specified here must reflect the type of the final transformed value instead of the initial type. For example:

{
  "type": "string", // initial type is "int", but final transformed type is "string"
  "transform": [
    {
      //
      "type": "...converts ints to strings..."
    }
  ]
}

title

The user-friendly label for this output value.

Example:

{
  "title": "Balance"
}

value

The value to display, specified as one of:

Examples:

{
  "value": "@input[tokenSymbol]"
}
{
  "value": "A fixed value"
}

transform (optional)

One or more transformations to apply to the output value prior to rendering it. If using this then note that the type parameter must reflect the type of the final transformed value.

Example:

{
  "transform": [
    {
      "type": "...",
      ...
    },
    {
      "type": "...",
      ...
    },
    ...
  ]
}

If transformations are set set then the output value becomes clickable so that the user is able to view both transformed and untransformed values:

Output value

Deprecated properties

scale (optional)

(This has been replaced by the intToScaledIntString transformation).

Applies to type: int

This is how to much to scale the output value by to obtain the displayable value. This means multiplying the input value by 10^scale to obtain the real value.

For example, if outputting an ETH value (which gets returned as WEI from a contract call) then the scale should be set to -18.

Example:

{
  "scale": "-18"
}

unit (optional)

(This has been replaced by the stringToSpacedSuffixedString transformation).

Applies to type: int

This is user-friendly text that gets shown next to the output value when scale is also set.

Example:

{
  "unit": "Tokens"
}