38 releases (stable)

22.0.0-rc.3 Oct 24, 2024
21.7.6 Oct 24, 2024
21.4.0 Jul 26, 2024
20.5.0 Mar 18, 2024
0.0.3 Jul 30, 2022

#1 in #soroban

Download history 2135/week @ 2024-07-19 3578/week @ 2024-07-26 2970/week @ 2024-08-02 1760/week @ 2024-08-09 2867/week @ 2024-08-16 2647/week @ 2024-08-23 2461/week @ 2024-08-30 2508/week @ 2024-09-06 2022/week @ 2024-09-13 2684/week @ 2024-09-20 2705/week @ 2024-09-27 2593/week @ 2024-10-04 2151/week @ 2024-10-11 1646/week @ 2024-10-18 2444/week @ 2024-10-25 2777/week @ 2024-11-01

9,647 downloads per month
Used in 56 crates (46 directly)

Apache-2.0

520KB
10K SLoC

Soroban SDK supports writing programs for the Soroban smart contract platform.

Docs

See soroban.stellar.org for documentation.

Examples

use soroban_sdk::{contract, contractimpl, vec, symbol_short, BytesN, Env, Symbol, Vec};

#[contract]
pub struct HelloContract;

#[contractimpl]
impl HelloContract {
    pub fn hello(env: Env, to: Symbol) -> Vec<Symbol> {
        vec![&env, symbol_short!("Hello"), to]
    }
}

#[test]
fn test() {
# }
# #[cfg(feature = "testutils")]
# fn main() {
    let env = Env::default();
    let contract_id = env.register(HelloContract, ());
    let client = HelloContractClient::new(&env, &contract_id);

    let words = client.hello(&symbol_short!("Dev"));

    assert_eq!(words, vec![&env, symbol_short!("Hello"), symbol_short!("Dev"),]);
}
# #[cfg(not(feature = "testutils"))]
# fn main() { }

More examples are available at https://soroban.stellar.org/docs/category/basic-tutorials and https://soroban.stellar.org/docs/category/advanced-tutorials.

Dependencies

~11–15MB
~315K SLoC