22 releases (stable)

new 21.4.0 Jul 26, 2024
21.1.1 Jun 25, 2024
20.5.0 Mar 18, 2024
20.0.3 Dec 20, 2023
0.0.3 Jul 30, 2022

#1414 in Magic Beans

Download history 2003/week @ 2024-04-04 2211/week @ 2024-04-11 1896/week @ 2024-04-18 2333/week @ 2024-04-25 2085/week @ 2024-05-02 2041/week @ 2024-05-09 1546/week @ 2024-05-16 1569/week @ 2024-05-23 1936/week @ 2024-05-30 1964/week @ 2024-06-06 2168/week @ 2024-06-13 2235/week @ 2024-06-20 1708/week @ 2024-06-27 1352/week @ 2024-07-04 3361/week @ 2024-07-11 2109/week @ 2024-07-18

8,980 downloads per month
Used in 49 crates (38 directly)

Apache-2.0

475KB
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_contract(None, 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

~10–14MB
~303K SLoC