28 releases (stable)

new 22.1.2 Dec 12, 2024
22.1.0 Nov 18, 2024
22.0.0-rc.3 Oct 22, 2024
21.2.2 Oct 24, 2024
0.0.3 Jul 29, 2022

#656 in Magic Beans

Download history 1999/week @ 2024-08-26 1290/week @ 2024-09-02 1458/week @ 2024-09-09 1020/week @ 2024-09-16 1221/week @ 2024-09-23 1551/week @ 2024-09-30 1081/week @ 2024-10-07 1277/week @ 2024-10-14 1429/week @ 2024-10-21 1629/week @ 2024-10-28 3351/week @ 2024-11-04 3539/week @ 2024-11-11 1960/week @ 2024-11-18 2338/week @ 2024-11-25 3667/week @ 2024-12-02 4121/week @ 2024-12-09

12,222 downloads per month
Used in 58 crates (via soroban-sdk)

Apache-2.0

205KB
4.5K 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

~7.5MB
~161K SLoC