12 stable releases

new 21.0.0 Apr 18, 2024
20.5.0 Mar 18, 2024
20.3.2 Feb 14, 2024
20.0.3 Dec 20, 2023
0.0.3 Jul 30, 2022

#1384 in Magic Beans

Download history 365/week @ 2023-12-23 236/week @ 2023-12-30 902/week @ 2024-01-06 1322/week @ 2024-01-13 748/week @ 2024-01-20 431/week @ 2024-01-27 1175/week @ 2024-02-03 1017/week @ 2024-02-10 1085/week @ 2024-02-17 1645/week @ 2024-02-24 1272/week @ 2024-03-02 1471/week @ 2024-03-09 1159/week @ 2024-03-16 2596/week @ 2024-03-23 1476/week @ 2024-03-30 1905/week @ 2024-04-06

7,332 downloads per month
Used in 39 crates (33 directly)

Apache-2.0

455KB
9K 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
~290K SLoC