16 stable releases

new 21.2.0 Jul 16, 2024
21.1.0 May 31, 2024
20.3.0 Mar 15, 2024
20.0.2 Dec 20, 2023
0.0.3 Jul 29, 2022

#1047 in Magic Beans

Download history 750/week @ 2024-03-25 1173/week @ 2024-04-01 1637/week @ 2024-04-08 1922/week @ 2024-04-15 1831/week @ 2024-04-22 1120/week @ 2024-04-29 1999/week @ 2024-05-06 1160/week @ 2024-05-13 907/week @ 2024-05-20 1521/week @ 2024-05-27 892/week @ 2024-06-03 994/week @ 2024-06-10 1044/week @ 2024-06-17 1418/week @ 2024-06-24 369/week @ 2024-07-01 915/week @ 2024-07-08

3,877 downloads per month
Used in 50 crates (via soroban-sdk)

Apache-2.0

205KB
4K SLoC

rs-soroban-env

Rust contract-environment interface and (optional) host implementation for Soroban.

The soroban-env-common crate contains elements of the shared environment-interface between smart contract guest and host: the Env trait that defines the set of available environment functions as well as the Val type that can pass back and forth through the WASM calling convention. Additionally small wrappers around subtypes of Val are included: Object, Symbol, Error, etc.

The soroban-env-guest crate contains the guest-side stub implementation of the environment interface called Guest dependent on extern fns provided by the host implementation. This can be used in a WASM runtime that provides the extern fns.

The soroban-env-host crate contains the host-side full implementation of the environment interface called Host. This can be used either in the real blockchain host, or for local testing in the SDK.


lib.rs:

This crate provides the [Guest] type, the "stub" implementation of the [Env] interface used for communicating between a contract guest and its host. It is only defined for cfg(target_family = "wasm").

It also re-exports all of the content of the [soroban_env_common] crate for use by guest code. Most of the type and module definitions visible here are actually defined in the common crate.

Dependencies

~7MB
~153K SLoC