176 lines
8.0 KiB
JSON
176 lines
8.0 KiB
JSON
{
|
|
"type": "replaceBy Config Property",
|
|
"definition": {
|
|
"text": "This property is used within API Path Parameter and API Query Parameter configs. It allows you to instruct the API Fetcher Bot to set a value for this parameter based on contextual information that cannot be predefined at the Data Mine or the API Map. For example, this contextual information could be the current Base Asset being used or the current Time.",
|
|
"updated": 1622684765167
|
|
},
|
|
"paragraphs": [
|
|
{
|
|
"style": "Block",
|
|
"text": "How To Use It",
|
|
"updated": 1622477226772
|
|
},
|
|
{
|
|
"style": "Title",
|
|
"text": "replaceBy Config Property Usage"
|
|
},
|
|
{
|
|
"style": "Text",
|
|
"text": "This property is optional, meaning that the Bot will use the default value when it is not present. The default value for both API Query Parameter and API Path Parameter is the codeName config property. An example of how this would look in a config is as follows:",
|
|
"updated": 1622685164654
|
|
},
|
|
{
|
|
"style": "Json",
|
|
"text": "{\n \"codeName\": \"currentBaseAsset\",\n \"isString\": false,\n \"isOptional\": false,\n \"description\": \"\",\n \"replaceBy\": \"@BaseAsset\"\n}",
|
|
"updated": 1622685104193
|
|
},
|
|
{
|
|
"style": "Text",
|
|
"text": "The following list lays out all the possible values you can use within the replaceBy property. ",
|
|
"updated": 1622685176762
|
|
},
|
|
{
|
|
"style": "Subtitle",
|
|
"text": "For Base Asset"
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@BaseAsset: This will force the Bot to use the current Base Asset."
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "parameterValue = TS.projects.foundations.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName",
|
|
"updated": 1622476773559
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@BaseAssetNameUppercase: This will force the Bot to use the current name of the Base Asset beginning with an uppercase letter.",
|
|
"updated": 1622683262892
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.name\nparameterValue = rawValue.toUpperCase()",
|
|
"updated": 1622683076901
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@BaseAssetNameLowercase: This will force the Bot to use the name of the current Base Asset beginning with a lowercase letter.",
|
|
"updated": 1622683250737
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode\n.parentNode.parentNode.referenceParent.baseAsset.referenceParent.name\nparameterValue = rawValue.toLowerCase()",
|
|
"updated": 1622683129110
|
|
},
|
|
{
|
|
"style": "Subtitle",
|
|
"text": "For Quoted Asset",
|
|
"updated": 1622684096573
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@QuotedAsset: This will force the Bot to use the current Quoted Asset."
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "parameterValue = TS.projects.foundations.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName",
|
|
"updated": 1622476849667
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@QuotedAssetNameUppercase: This will force the Bot to use the name of the current Base Asset beginning with an uppercase letter.",
|
|
"updated": 1622683649444
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.name\nparameterValue = rawValue.toUpperCase()",
|
|
"updated": 1622683501102
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@QuotedAssetNameLowercase: This will force the Bot to use the name of the current Base Asset beginning with a lowercase letter.",
|
|
"updated": 1622683656687
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.name\nparameterValue = rawValue.toLowerCase()",
|
|
"updated": 1622683457003
|
|
},
|
|
{
|
|
"style": "Subtitle",
|
|
"text": "For Exchange",
|
|
"updated": 1622684422398
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@Exchange: This will force the Bot to use the current Exchange."
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "parameterValue = TS.projects.foundations.globals.taskConstants.TASK_NODE \n.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.codeName",
|
|
"updated": 1622682215370
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@ExchangeNameUppercase: This will force the Bot to use the name of the current Exchange beginning with an uppercase letter.",
|
|
"updated": 1622684044204
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name\nparameterValue = rawValue.toUpperCase()",
|
|
"updated": 1622683827954
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@ExchangeNameLowercase: This will force the Bot to use the name of the current Exchange beginning with a lowercase letter.",
|
|
"updated": 1622684016700
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "rawValue = TS.projects.foundations.globals.taskConstants.TASK_NODE\n.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name\nparameterValue = rawValue.toLowerCase()",
|
|
"updated": 1622683964537
|
|
},
|
|
{
|
|
"style": "Subtitle",
|
|
"text": "For Timestamp",
|
|
"updated": 1622684458481
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@BeginCurrentMinute: This will instruct the Bot to use a timestamp at the begining of the current minute."
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "parameterValue = \nMath.trunc((new Date()).valueOf() / \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS",
|
|
"updated": 1622477009814
|
|
},
|
|
{
|
|
"style": "List",
|
|
"text": "@EndCurrentMinute: This will instruct the Bot to use a timestamp at the ending of the current minute.",
|
|
"updated": 1622476926765
|
|
},
|
|
{
|
|
"style": "Javascript",
|
|
"text": "parameterValue = Math.trunc((new Date()).valueOf() / \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS + \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1",
|
|
"updated": 1622477088684
|
|
},
|
|
{
|
|
"style": "Note",
|
|
"text": "If users access a value that is not listed above, the property will be ignored and the default value will be used.",
|
|
"updated": 1622682302500
|
|
},
|
|
{
|
|
"style": "Success",
|
|
"text": "Name values are drawn from the asset labels held within the Exchange Assets node.",
|
|
"updated": 1622684251888
|
|
},
|
|
{
|
|
"style": "Text",
|
|
"text": ""
|
|
},
|
|
{
|
|
"style": "Text",
|
|
"text": ""
|
|
}
|
|
]
|
|
} |