Skip to main content

Ignite CLI Supported Types

Types with CRUD operations are scaffolded with the ignite scaffold command.

Built-in types

TypeAliasIndexCode TypeDescription
string-yesstringText type
array.stringstringsno[]stringList of text type
bool-yesboolBoolean type
int-yesint32Integer type
array.intintsno[]int32List of integers types
uint-yesuint64Unsigned integer type
array.uintuintsno[]uint64List of unsigned integers types
coin-nosdk.CoinCosmos SDK coin type
array.coincoinsnosdk.CoinsList of Cosmos SDK coin types

Some types cannot be used an index, like the map and list indexes and module params.

Custom types

You can create custom types and then use the custom type later.

For example, you can create a list type called user and then use the user type in a subsequent ignite scaffold command.

Here's an example of how to scaffold a new CoordinatorDescription type that is reusable in the future:

ignite scaffold list coordinator-description description:string --no-message

Now you can scaffold a message using the CoordinatorDescription type:

ignite scaffold message add-coordinator address:string description:CoordinatorDescription

Run the chain and then send the message using the CLI.

To pass the custom type in JSON format:

ignite chain serve
marsd tx mars add-coordinator cosmos1t4jkut0yfnsmqle9vxk3adfwwm9vj9gsj98vqf '{"description":"coordinator description"}' true --from alice --chain-id mars

If you try to use a type that is not created yet, the follow error occurs:

ignite scaffold message validator validator:ValidatorDescription address:string
-> the field type ValidatorDescription doesn't exist