⚒️Using Utilities
Griptape has many other utilities to help you solve some of the most common but non-trivial problems you will find while developing your application. Here we are going through some of them briefly.
Numbers
It is common in dApps to perform operations on big numbers. Most of these numbers are represented in strings, which for some cases formatting and handling a proper way for displaying them might cause some problems. For that you have a coinConvert
function to help you manage those cases:
Formatting
Formatting addresses and viewing keys is very common in Secret Network dApps. bech32
can help abbreviate those:
Accounts
Here are some features that will help you get information about the account that is connected to your app.
The getAddress()
function is imported directly from '@stakeordie/griptape.js'
and it's enough to declare a variable and assign the result of this function. getAddress()
will help you know the address
of the account connected to your application.
If you want to know the more information about the account connected to your application, the function getWalletInfo()
should suffice.
To find out if you have an available account connected to your application, you can use the isAccountAvailable()
function which will return a boolean value depending on the status of the account.
Last updated