Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.43 KB

README.md

File metadata and controls

51 lines (37 loc) · 1.43 KB

gstd-fluent

Build License Docs

A wrapper over gstd that provides a fluent interface to interact with the Gear Protocol.

To use the default implementation, you should replace gstd with gstd-fluent in your Cargo.toml file:

gstd-fluent = { git = "https://github.com/gear-foundation/gstd-fluent.git" }

Then update your code like this:

#![no_std]

use gstd_fluent::{
    self as builder,
    gstd::{self, prelude::*, ActorId},
    //     ^^^^ Useful when working with gstd attribute macros
};

#[no_mangle]
extern "C" fn handle() {
    // Equivalent to `msg::send_with_gas`
    builder::send(ActorId::zero(), String::from("input"))
        .with_value(42)
        .with_gas_limit(1_000_000)
        .execute()
        .expect("failed to send msg");
}

For more examples, please visit the documentation.

License

The source code is licensed under the MIT license.