#soroban #stellar #rust

stellar-baselib

A low level Rust library that offers a comprehensive set of functions for reading, writing, hashing, and signing primitive XDR constructs utilized in the Stellar network

43 releases

new 0.5.1 Apr 23, 2025
0.4.9 Mar 17, 2025
0.4.5 Dec 27, 2024
0.4.2 Nov 20, 2024
0.1.5 Jul 20, 2023

#124 in Magic Beans

Download history 3/week @ 2025-01-01 106/week @ 2025-01-08 36/week @ 2025-01-15 6/week @ 2025-01-22 12/week @ 2025-01-29 139/week @ 2025-02-05 338/week @ 2025-02-12 138/week @ 2025-02-19 26/week @ 2025-02-26 86/week @ 2025-03-05 239/week @ 2025-03-12 77/week @ 2025-03-19 91/week @ 2025-03-26 9/week @ 2025-04-02 221/week @ 2025-04-09 171/week @ 2025-04-16

511 downloads per month
Used in soroban-client

Apache-2.0 and LGPL-3.0+

350KB
9K SLoC

Stellar Base Library

Crates.io Crates.io Crates.io

A library that offers a comprehensive set of functions for reading, writing, hashing, and signing primitive XDR constructs utilized in the Stellar network. it provides a nice abstraction for building and signing transactions

This project is currently alpha-ish and is compatible with Protocol 22 and you can use it for buidling and signing transactions that involve interacting with Soroban. It is a work in progress and is subject to significant changes, including the addition or removal of features and modifications to its functionality.

Quickstart

Add this to your Cargo.toml:

[dependencies]
stellar-baselib = "0.5.1"

And this to your code:

use stellar_baselib::*;

How to run tests

cargo test

Coding Best Practices Used

  1. All Rust code is linted with Clippy with the command cargo clippy. If preferred to ignore its advice, do so explicitly: #[allow(clippy::too_many_arguments)]

  2. All rust code is formatted with cargo fmt. rustfmt.toml defines the expected format.

  3. Function and local variable names follow snake_case. Structs or Enums follow CamelCase and Constants have all capital letters.

Dependencies

~15–27MB
~370K SLoC