Crates.io | neutron-std |
lib.rs | neutron-std |
version | 5.0.1-rc0 |
source | src |
created_at | 2023-08-13 12:31:44.586277 |
updated_at | 2024-11-21 12:48:14.810651 |
description | Standard library for Neutron with CosmWasm support included. This package is a modified copy of the osmosis package - https://github.com/osmosis-labs/osmosis-rust/tree/main/packages/osmosis-std |
homepage | https://neutron.org |
repository | https://github.com/neutron-org/neutron-std |
max_upload_size | |
id | 943288 |
size | 1,564,744 |
Neutron's proto-generated types and helpers for interacting with the appchain. Compatible with CosmWasm contract.
You can find all types and querier generated from Neutron's protobuf in their respective module in neutron_std
.
use cosmwasm_std::{CosmosMsg, Response, Env};
use neutron_std::types::osmosis::tokenfactory::v1beta1::MsgCreateDenom;
# type ContractError = cosmwasm_std::StdError;
// ..
pub fn try_create_denom(env: Env, subdenom: String) -> Result<Response, ContractError> {
let sender = env.contract.address.into();
// construct message and convert them into cosmos message
// (notice `CosmosMsg` type and `.into()`)
let msg_create_denom: CosmosMsg = MsgCreateDenom { sender, subdenom }.into();
Ok(Response::new()
.add_message(msg_create_denom)
.add_attribute("method", "try_create_denom"))
}