6 releases (1 stable)
new 5.1.2 | Feb 12, 2025 |
---|---|
5.0.1-rc0 | Nov 21, 2024 |
4.2.2-rc | Sep 3, 2024 |
4.0.1-rc.1 | Jun 26, 2024 |
1.0.4-rc.1 | Aug 13, 2023 |
#166 in Magic Beans
152 downloads per month
1.5MB
42K
SLoC
neutron-std
Neutron's proto-generated types and helpers for interacting with the appchain. Compatible with CosmWasm contract.
CosmWasm stargate message and stargate query
You can find all types and querier generated from Neutron's protobuf in their respective module in neutron_std
.
Executing Neutron messages from CosmWasm Contract
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"))
}
Dependencies
~18MB
~374K SLoC