18 releases (11 stable)

new 21.1.0-rc.1 May 31, 2024
21.0.1-preview.1 Apr 24, 2024
20.5.0 Mar 18, 2024
20.0.3 Dec 20, 2023
0.0.3 Jul 30, 2022

#1389 in Magic Beans

Download history 1051/week @ 2024-02-09 1075/week @ 2024-02-16 1566/week @ 2024-02-23 1378/week @ 2024-03-01 1417/week @ 2024-03-08 1197/week @ 2024-03-15 2597/week @ 2024-03-22 1296/week @ 2024-03-29 2295/week @ 2024-04-05 2199/week @ 2024-04-12 1798/week @ 2024-04-19 2278/week @ 2024-04-26 2149/week @ 2024-05-03 1924/week @ 2024-05-10 1502/week @ 2024-05-17 1217/week @ 2024-05-24

7,112 downloads per month
Used in 46 crates (37 directly)

Apache-2.0

470KB
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