TradestoryTradeStory Website↗️

No results

Help CenterStoriesTradeScript™ EditorTradeScript™ Editor

TradeScript™ Editor

Last updated February 10, 2024

TradeScript™ is an expressive description language based on JSON, which all Trade Stories are ultimately stored in.  You can switch between the Visual Story Editor, and the TradeScript™ code editor easily.  When building your stories in the visual editor, you can see what TradeScript™ is being generated by toggling between the two modes.

Example: The following story simply logs out a message to the logs, seen toggled in TradeScript™ mode.

{
 "story": {
   "story_items": [
     {
       "item": "LOG_MESSAGE",
       "name": "Log out a message",
       "message": {
         "data_type": "VALUE",
         "value": "my message"
       }
     }
   ]
 }
}

Any changes you make to your Story in TradeScript™ mode will be available in the Visual Editor mode and visa-versa.  

Because TradeScript™ relies on valid JSON schema and formatting, the editor does its best to help you with formatting, code coloring and highlighting.  If there is an error, the code will not be able to be saved and you will receive an error message so you can correct the issue.

The anatomy of a story consists of a root story item, with an array of story_items, which TradeStory can read and interpret.

{
 "story": {
   "story_items": [
     { story_item },
     { story_item },
     { story_item },
     ...
   ]
 }
}

Was this article helpful?