Modern applications are built on top of a variety of different protocols each of which require support from SDKs in every language - reimplementing the same underlying logic and types over and over again. sb-stack unifies these efforts into a single composable rust core for building protocol specific clients with bindings into higher level languages like python and typescript. While the real benefits are in maintaining 1 package vs 1 per language (and per chain), sb-stack also ships with a universal middleware ecosystem (retries, telemetry, load balancing) and a core that is 5 times faster than native language implementations like axios, fetch, and httpx.
-
1.0 — Transport Layer Architecture Generic abstraction powering all transports
-
1.1 — HTTP Transport HTTP/1.1 and HTTP/2 with connection pooling and middleware
-
1.2 — WebSocket Transport Real-time bidirectional communication with pub/sub patterns
-
2.0 — Protocol Services Overview of protocol-specific services
-
2.1 — JSON-RPC Service JSON-RPC 2.0 implementation with HTTP and WebSocket support
-
3.0 — Blockchain RPC Clients Guide to assembling transports and services into blockchain clients
-
3.1 — Ethereum Client Complete Ethereum JSON-RPC client with batch processing and subscriptions
Rust
use sb_stack_transport_http::{
HttpTransport,
Http1TransportConfig,
HttpTransportRequestPacket
};
async fn example() -> Result<(), Box<dyn std::error::Error>> {
let base_url = "https://httpbin.org".parse()?;
let mut transport = HttpTransport::new(
base_url.clone(), Http1TransportConfig::default(), None
);
transport.connect().await?;
let mut request = HttpTransportRequestPacket::new(http::Method::GET);
request.set_url(Some(base_url.join("/get")?));
let response = transport.call(request).await?;
Ok(())
}Python
from sb_http_client import HttpClient
async def example():
client = HttpClient("https://httpbin.org")
response = await client.get("/get")
print(f"Status: {response.status}")Typescript
import { HttpClient } from 'sb-http-client';
async function example() {
const client = new HttpClient({ baseURL: 'https://httpbin.org' });
const response = await client.get('/get');
console.log('Status:', response.status);
}Rust
use sb_eth_jsonrpc_client::EthJsonrpcClient;
async fn example() -> Result<(), Box<dyn std::error::Error>> {
let client = EthJsonrpcClient::new("https://eth.rpc.sudoblock.io");
client.connect().await?;
let block = client.eth().get_block_by_number(12345.into(), true).await?;
println!("Block: {}", block.number);
client.close().await?;
Ok(())
}Python
from sb_eth_jsonrpc_client import EthJsonrpcClient
async def example():
client = EthJsonrpcClient("https://eth.rpc.sudoblock.io")
await client.connect()
block = await client.eth().get_block_by_number(12345, True)
print(f"Block: {block.number}")
await client.close()Typescript
import { EthJsonrpcClient } from 'sb-eth-jsonrpc-client';
async function example() {
const client = new EthJsonrpcClient("https://eth.rpc.sudoblock.io");
await client.connect();
const block = await client.eth().getBlockByNumber(12345, true);
console.log(`Block: ${block.number}`);
await client.close();
}