The Namada SDK
The Namada software development kit (SDK) can be found in the namada
repo under the path namada/shared
(opens in a new tab). The SDK is written in Rust and can be used to interact with the Namada blockchain, by constructing transactions, signing them, and submitting them to the network.
Quick Start
A good starting point to see the SDK in use is to check-out the namada interface (opens in a new tab) repo. This repo contains a simple web application that uses the SDK to interact with the Namada blockchain. However, it is important to note the added complexity arising from the application integrating javascript using wasm-bindgen (opens in a new tab), which is not necessary.
Installation
The Namada SDK can be installed by creating a new Rust project and adding the following to the Cargo.toml
file:
[package]
name = "namada-sdk-starter"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
async-std = "1.11.0"
async-trait = "0.1.51"
borsh = "0.9.0"
file-lock = "2.0.2"
futures = "0.3.28"
getrandom = { version = "0.2" }
masp_primitives = { git = "https://github.com/anoma/masp.git", rev = "50acc5028fbcd52a05970fe7991c7850ab04358e" }
masp_proofs = { git = "https://github.com/anoma/masp.git", rev = "50acc5028fbcd52a05970fe7991c7850ab04358e", features = ["download-params"]}
# Make sure the rev is to the latest version of namada in the below repo
namada_sdk = { git = "https://github.com/anoma/namada.git", rev = "v0.24.0", default-features = false, features = ["abciplus", "namada-sdk", "std"] }
rand = {version = "0.8", default-features = false}
rand_core = {version = "0.6", default-features = false}
tendermint-config = {git="https://github.com/heliaxdev/tendermint-rs.git", rev="b7d1e5afc6f2ccb3fd1545c2174bab1cc48d7fa7"}
tendermint-rpc = {git="https://github.com/heliaxdev/tendermint-rs.git", rev="b7d1e5afc6f2ccb3fd1545c2174bab1cc48d7fa7", features = ["http-client"]}
thiserror = "1.0.38"
tokio = {version = "1.8.2", default-features = false}
toml = "0.5.8"
zeroize = "1.5.5"
[patch.crates-io]
borsh = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-derive = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-schema-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
Once the sdk is installed, you can use it to interact with the Namada blockchain.