⚡Utilities
This package contains various utility methods to help you quickly bootstrap your blockchain-powered application.
There are many utility methods exported from the utils
package. We'll present a few examples of the more commonly used utility and useful methods, but take a look at the entire API here.
Installation
Install the package in your project directory with:
You can import individual methods and constants from the utilities package with the following:
or the CommonJS way:
Featured Methods
Interacting with Contracts
Simulate Transaction
To see the final result of a read or write smart contract method without writing to the blockchain.
Formatting
Normalize Value
Formats any number type to an object containing the string value as well as the big number value.
Datetime
UNIX Timestamp to Date
Formats number type to a Date to assist in displaying on your UI. Especially useful when working with our subgraphs.
Get Date X Days Ago
Quickly get new past date by inputting the amount of days from today.
Last updated