Official SDKs
Five first-party SDKs and a CLI. All speak the same JSON-RPC, all support composite signing, all stay version-aligned with the node.
Compatibility matrix
TypeScript
Node 20+, Bun 1+, Deno 2+, browsers. npm: @quanchain/sdk. Tree-shakeable ESM.
Python
3.10+. pypi: quanchain. Sync + async clients, composite signing via native extension.
Rust
crates.io: quanchain. The reference implementation — node + SDK share a core.
Go
1.22+. go get github.com/quanchain/go-quanchain. Pure-Go, no cgo dependency.
Swift
iOS 16+. SwiftPM: QuanChainKit. Backed by the Rust core via UniFFI.
Kotlin
Android 9+ (API 28). Maven: ai.quanchain:sdk. Coroutines-friendly.
TypeScript SDK
npm install @quanchain/sdk
# or
bun add @quanchain/sdkimport { QuanChain } from '@quanchain/sdk';
const chain = new QuanChain({
network: 'testnet',
apiKey: process.env.QC_KEY, // optional
});
const head = await chain.chain.head(1);
console.log('Channel 1 head:', head.height);
const wallet = await chain.wallet.fromSeed(process.env.SEED!);
await wallet.transfer({ to: 'QC10_...', amount: '1.0', channel: 1 });The TypeScript SDK is the canonical first-party SDK. Type definitions match the RPC spec one-to-one and ship with JSDoc references back to the on-chain RPC.
Python SDK
pip install quanchain
# or
uv add quanchainfrom quanchain import QuanChain
chain = QuanChain(network="testnet")
wallet = chain.wallet.from_seed(SEED)
receipt = wallet.transfer(to="QC10_...", amount="1.0", channel=1)
print(receipt.tx_hash, receipt.new_child_address)quanchain.asyncio.QuanChain — the same surface but every method returns a coroutine.Rust SDK
cargo add quanchainuse quanchain::{QuanChain, Network};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let chain = QuanChain::connect(Network::Testnet).await?;
let wallet = chain.wallet().from_seed(&std::env::var("SEED")?)?;
let receipt = wallet.transfer("QC10_...", "1.0", 1).await?;
println!("rotated to {}", receipt.new_child_address);
Ok(())
}Go SDK
go get github.com/quanchain/go-quanchainpackage main
import (
"context"
"log"
qc "github.com/quanchain/go-quanchain"
)
func main() {
ctx := context.Background()
chain, err := qc.Dial(ctx, qc.Testnet)
if err != nil { log.Fatal(err) }
wallet, _ := chain.Wallet.FromSeed(SEED)
rcpt, _ := wallet.Transfer(ctx, &qc.Transfer{
To: "QC10_...", Amount: "1.0", Channel: 1,
})
log.Println("rotated to", rcpt.NewChildAddress)
}Swift / Kotlin
Both mobile SDKs are thin bindings over the Rust core via UniFFI. They expose a coroutine-friendly API on Android and an async/await API on iOS.
import QuanChainKit
let chain = try QuanChain.connect(.testnet)
let wallet = try chain.wallet.fromSeed(seed)
let receipt = try await wallet.transfer(
to: "QC10_...", amount: "1.0", channel: 1
)val chain = QuanChain.connect(Network.Testnet)
val wallet = chain.wallet.fromSeed(seed)
val receipt = wallet.transfer(
to = "QC10_...", amount = "1.0", channel = 1
)QuanChain CLI
The quanchain CLI ships pre-built for Linux, macOS, and Windows. Useful for one-off scripts, faucet requests, and debugging.
# install
curl -fsSL https://get.quanchain.ai/cli | bash
# probe the chain
quanchain head --channel 1
# send a transfer
quanchain wallet from-seed "$(cat ~/.quanchain/seed)" \
| quanchain spend --to QC10_... --amount 1.0 --channel 1Support policy
- Each SDK follows semver; the major version aligns with the node major.
- RPC additions are non-breaking. Removals require a one-year deprecation window.
- Two stable major versions are supported in parallel during a transition.
- Security patches are back-ported to every supported major.
Open issues against the SDKs at github.com/quanchain.