#message #query #contracts #msg #sender #cosmwasm #omniflix

omniflix-std

Standard library for Omniflix cosmwasm contracts

11 releases

new 0.1.8 May 11, 2024
0.1.7 May 10, 2024
0.1.5 Apr 23, 2024
0.1.3 Feb 16, 2024
0.0.1 Oct 19, 2023

#430 in Magic Beans

Download history 5/week @ 2024-02-05 113/week @ 2024-02-12 72/week @ 2024-02-19 24/week @ 2024-02-26 40/week @ 2024-04-01 123/week @ 2024-04-15 148/week @ 2024-04-22 2/week @ 2024-04-29 452/week @ 2024-05-06

725 downloads per month

MIT/Apache

1MB
19K SLoC

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()?;

Dependencies

~5–7MB
~145K SLoC