omniflix-std 0.1.0

Standard library for Omniflix cosmwasm contracts
docs.rs failed to build omniflix-std-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: omniflix-std-1.1.0-beta

omniflix-std

omniflix-std on crates.io

Overview

The omniflix-std crate includes generated Rust types and macros to facilitate the creation of Stargate messages and queries.

Usage

To use this crate in your Rust project, add the following to your Cargo.toml file:

[dependencies]
omniflix-std = { version = "" }

Example: Creating a Collection

use omniflix_std::types::omniflix::onft::v1beta1::MsgCreateDenom;

pub fn create_collection(_deps, _env, msg) {
    let collection_details = msg.collection_details;
    let {
        id,
        creation_fee,
        description,
        name,
        preview_uri,
        schema,
        sender,
        symbol,
        uri,
        uri_hash,
        data,
    } = collection_details;

    let msg: CosmosMsg = MsgCreateDenom {
        id,
        creation_fee: fee_coin.into(),
        description,
        name,
        preview_uri,
        schema,
        sender,
        symbol,
        uri,
        uri_hash,
        data,
    }
    .into();

    Ok(Response::new().add_message(msg))
}

Example: Querying Stargate

use omniflix_std::types::omniflix::onft::v1beta1::OnftQuerier;
use omniflix_std::types::omniflix::onft::v1beta1::QueryParamsResponse;

let onft_querier = OnftQuerier::new(&deps.querier);
let res: QueryParamsResponse = onft_querier.params()?;