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

omniflix-std

Standard library for Omniflix cosmwasm contracts

13 releases

new 1.0.2-beta Oct 28, 2024
1.0.0-beta Jun 23, 2024
0.2.1 Jun 21, 2024
0.1.3 Feb 16, 2024
0.0.1 Oct 19, 2023

#927 in Magic Beans

Download history 27/week @ 2024-07-08 310/week @ 2024-07-15 327/week @ 2024-07-22 291/week @ 2024-07-29 53/week @ 2024-08-05 340/week @ 2024-08-12 28/week @ 2024-09-02 106/week @ 2024-09-09 93/week @ 2024-09-16 97/week @ 2024-09-23 9/week @ 2024-09-30 39/week @ 2024-10-07 325/week @ 2024-10-14 27/week @ 2024-10-21

401 downloads per month

MIT/Apache

1MB
24K 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.5–9MB
~179K SLoC