Mesh Data
Parse and manipulate data with Mesh Data type
Mesh provides a full set of utility functions to help constructing the Mesh Datatype you need for your Web3 app.
Types Support
All utility functions start with the prefix of m and all types All the utility functions start with the prefix of m, and are designed to return a type with the same naming as the utilities function, with capitalizing first letter, you can build your data with type supports in complex types, some examples:
mConstrreturnsMConstrtypemBoolreturnsMBooltype
Utilities in Building Constructor Mesh Data
mConStr build the constructor object in Mesh Data type, with parameters:
- alternative (number) - the constructor index
- fields (any[]) - the constructor fields in array
There are also some quick utilities only taking in fields as parameters for 0 - 2 indices:
mConStr0- building index 0 constructormConStr1- building index 1 constructormConStr2- building index 2 constructor
Building Mesh constructor object
Utilities in Building Primitives Mesh Data
mBool build the boolean object in , with parameters:
- b (boolean | boolean) - the boolean to be built
For the rest of data primitives, they are represented by JS primitives:
- Integer -
numberandbigint - Byte string -
string - List - JS
Array - Map - JS
Map
Building Mesh bool object
Other Utilities
The code example showing above does not cover all utilities, please checkout the hosted documentation for more details. The not covered utilities are as below:
mAssetClassmOutputReferencemTxOutRefmTuplemMaybeStakingHashmPubKeyAddressmScriptAddress