Functions
This section provides information about the functions that are supported within card definitions.
Use the functions to link cards to event handlers, execute operations to fetch data, validate data input, navigate between cards, and manage other interactions.
Fetching data
Function.SOLVE.getTokenBalance
Fetches the available SOLVE token balance after joining a network.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKeys | array | Not required |
totalKey | string | Not required |
resultKey | string | The key name in which you want to store the final outcome of the function. |
Function.SOLVE.getExchangeRate
Fetches the exchange value of SOLVE from USD.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKeys | array | The key name, which has a value in USD and is passed as an input to the function. |
resultKey | string | The key name in which you want to store the final outcome of the function. |
Function.Profile.key
Shows user profile data inside the network.
Parameter
Field | Value | Description |
---|---|---|
text | string | The name of the function: The following keys can be used as input:
|
Function.PROTOCOL.preLoadData
Executes a GET request to the user node.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
url | string | The URL path where the data is stored. |
Function.getGPSLocation
Fetches user's current location latitude and longitude.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKeys | array | The key names that correspond to the user's location coordinates (latitude and longitude). |
Function.Preference.language
Shows user preference data such as language preference.
Parameter
Field | Value | Description |
---|---|---|
text | string | The name of the function: |
Performing calculations
Function.data.totalCount
Shows the total count of fetched data.
Parameter
Field | Value | Description |
---|---|---|
text | string | The name of the function: |
Function.calculateSum
Calculates the total sum of all input value.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKeys | array | The names of the keys on which you want to calculate the sum. |
resultKey | string | The key name in which you want to store the final outcome of the function. |
NAVIGATE | string | The value of the card ID where you want to navigate after getting the result from the function. If you want to show results on the same card, then use the same card ID. |
Function.calculateSubtract
Calculates the subtraction of the input value.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKey | string | The key name that you want to subtract from the totalKey. |
totalKey | string | The key name from which the source key value gets subtracted. |
resultKey | string | The key name in which you want to store the final outcome of the function. |
NAVIGATE | string | The value of the card ID where you want to navigate after getting the result from the function. If you want to show results on the same card, then use the same card ID. |
Function.calculateMultiply
Calculates the multiplication of all input values.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKeys | array | The key names on which you want to calculate multiplication. |
resultKey | string | The key name in which you want to store the final outcome of the function. |
NAVIGATE | string | The value of the card ID where you want to navigate after getting the result from the function. If you want to show results on the same card, then use the same card ID. |
Function.calculateDivide
Calculates the division of the input value.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKey | string | The key name that you want to get divided from the totalKey. |
totalKey | string | The key name from which the source key value gets divided. |
resultKey | string | The key name in which you want to store the final outcome of the function. |
Function.calculatePercentage
Calculates the percentage of the input value.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKey | string | The key name that has the percentage value, like 10% should be used as 10, 20% should be used as 20. |
totalKey | string | The key name on which sourceKey will be applied. For example, if sourceKey has a key name with a value of 10 and totalKey has a key name with a total value of 200, the outcome will be 10 * 200 / 100 = 20. |
resultKey | string | The key name on which the final outcome of the function is stored. |
NAVIGATE | string | The value of the card ID where you want to navigate after getting the result from the function. If you want to show results on the same card, then use the same card ID. |
Validating data input
Function.validateReferralCode
Validates if the referral code entered is a valid TuumIO Wallet ID.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
resultKey | string | The input key for referral code. For example: |
Check field format and field value
Validates field format and value. This function is used in SmartTile1.
Parameter
Field | Value | Description |
---|---|---|
fieldFormat | string | The name of the field value to be validated. The supported fieldFormat values are:
|
min | string | The minimum length of the field value. |
max | string | The maximum length of the field value. |
validation | string | The validation whether field is required and the error message. |
name | string | The validation whether field is required. |
error | string | The error message that shows when the value entered in invalid. |
Linking and navigation
Function.When.Condition.Navigate
Shows a default empty card when no data is fetched, otherwise it moves to a specific card based on the whenConditionKey
value within the data. This function allows displaying different cards based on various conditions.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
method | string | The method used to fetch data: |
url | string | The path of the transaction data collection. |
cardId | string | The reference ID of the current card. |
whenConditionKey | string | The key name which represents the condition values, such as |
whenConditions | array | The list of condition values and card IDs. |
conditionValue | string | The value of the condition. |
conditionCardId | string | The card ID reference of the destination card. |
Function.When.Condition.PreLoad
Shows a default empty card when no data is fetched, otherwise it stays on the current card. For the description of parameters, see Function.When.Condition.Navigate.
Function.Navigate
Moves to the destination card without calling events or event handlers. This function also supports calculating and comparing values.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
cardId | string | The card ID reference of the destination card. |
Function.ChangeCard
Pushes to a new view after comparing the compareKey values.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
compareKey | string | The dynamic value based on results from another function. |
compareValue | integer | The fixed value to which the compareKey value is compared to. |
cardIdForGreaterValue | string | The card ID that is viewed when the compareKey value is greater than the fixed value set in compareValue. |
cardIdForLessValue | string | The card ID that is viewed when the compareKey value is less than the fixed value set in compareValue. |
cardId | string | The card ID of the current view. |
Function.deposit.SOLVE
Navigates from any card to the "SOLVE" tab view.
Parameter
Field | Value | Description |
---|---|---|
uiAction | string | The name of the function: |
Multiple selection
Allows multiple item selection for Tile12: Dropdown Option Selector.
Parameter
Field | Value | Description |
---|---|---|
fieldFormat | string | The value that allows selecting multiple items in a dropdown list. |
isLink or isUrl
Adds links inside the text of a tile, such as Tile0: Text Label.
Parameter
Field | Value | Description |
---|---|---|
isLink or isURL | string | To enable the link features in a tile, the value is set to |
urls | array | The list of labels and URLs. If isLink or isURL is set to "true", then this property is required. |
label | string | The title or subtitle text that will be clickable from the tile. |
url | string | The URL that opens when the label text is clicked. |
Function.CallEventHandler
Executes other functions to pass user input to the next card.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
method | string | The user input data to pass to the next card. |
Function.COPY.TEXT
Copies the subtitle or title text from specific tiles.
Parameter
Field | Value | Description |
---|---|---|
uiAction | string | The name of the function: |
Function.camera_selfie
Captures a selfie or selects from the gallery.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
resultKey | string | The key name which will save the image in base64 format and will be added to the payload to be sent to the node. |
Function.uploadFiles
Uploads multiple files in AttachmentUploadTile
.
Parameter
Field | Value | Description |
---|---|---|
name | string | The name of the function: |
sourceKeys | array | The input key of the AttachmentUploadTile. For example, for input key |
resultKey | string | The final submit key for storing data. |
timestampKey | string | The time in milliseconds when the file is successfully uploaded. |
Last updated