CosmWasm / cosmwasm

Framework for building smart contracts in Wasm for the Cosmos SDK
https://www.cosmwasm.com/
Apache License 2.0
1.07k stars 336 forks source link

Can I pass in the type `Uint256` in the `cli`. `cli` or `sdk` supports several data types. #1763

Closed 99Kies closed 1 year ago

99Kies commented 1 year ago

Can I pass in the type Uint256 in the cli. cli or sdk supports several data types.

such as:

#[cw_serde]
pub enum ExecuteMsg {
    SetParams {
        flag: Uint256,
    },
...
}

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(Period)]
    GetPeriod { index: Uint256 },
    ...
}
webmaster128 commented 1 year ago

Yes you can. In fact, it is designed for that. See https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md for information how to encode it in JSON.