#module #query #message #cosmwasm

neutron-std

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

5 releases (0 unstable)

new 5.0.1-rc0 Nov 21, 2024
4.2.2-rc Sep 3, 2024
4.0.1-rc.1 Jun 26, 2024
4.0.0-rc.3 Jun 25, 2024
1.0.4-rc.1 Aug 13, 2023

#464 in #message

Download history 342/week @ 2024-08-01 4/week @ 2024-08-08 8/week @ 2024-08-22 253/week @ 2024-08-29 203/week @ 2024-09-05 177/week @ 2024-09-12 50/week @ 2024-09-19 67/week @ 2024-09-26 102/week @ 2024-10-03 90/week @ 2024-10-10 37/week @ 2024-10-17 51/week @ 2024-10-24 40/week @ 2024-10-31 6/week @ 2024-11-07 31/week @ 2024-11-14

130 downloads per month

MIT/Apache

1.5MB
40K SLoC

neutron-std

neutron-std on crates.io Docs

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
~369K SLoC