Stellar Ecosystem · MIT Licensed

Soroban Smart Contracts
in Idiomatic Go

A typed Go client library and CLI for reading Soroban contract state on Stellar. Built for indexers, bots, monitoring, and backend infrastructure.

$ go get github.com/Northbound-Dev/soroban-go-toolkit
6
RPC Methods
100%
Test Covered
0
External Deps
Go 1.24
Minimum Version
Why this exists

Go developers shouldn't have to hand-roll JSON-RPC

Most Soroban tooling targets Rust or TypeScript. But Go is where a lot of backend infrastructure actually lives — indexers, bots, monitoring, internal services.

Developers reaching for Soroban in Go have had to manually construct JSON-RPC calls and wrestle with XDR encoding themselves. This toolkit fills that gap with idiomatic, typed Go bindings for the Stellar Soroban RPC API.

Capabilities

Everything you need

Complete RPC Client

Typed request/response structs for getHealth, getLatestLedger, getContractData, simulateTransaction, and more — with proper error handling.

Ready-to-Use CLI

A command-line interface wrapping all client functionality for easy scripting, automation, and quick queries against Stellar testnet.

Working Examples

Copy-pasteable quickstart examples that run against public Stellar testnet with zero configuration required.

Zero Dependencies

No third-party packages. Only the Go standard library — keeping your dependency tree clean and build times fast.

CI Validated

Tested in CI on every push. Type-safe, well-tested, and designed for production backend services.

Contract Helpers

High-level helper methods built on top of getLedgerEntries for easier contract state and instance reading.

Quick Start

Up and running in seconds

Library go get github.com/Northbound-Dev/soroban-go-toolkit
CLI go install github.com/Northbound-Dev/soroban-go-toolkit/cmd/sorobango@latest
main.go
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/Northbound-Dev/soroban-go-toolkit/pkg/soroban"
)

func main() {
    // With no options the client targets the public Stellar testnet.
    client, err := soroban.New()
    if err != nil {
        log.Fatal(err)
    }

    ctx := context.Background()

    health, err := client.GetHealth(ctx)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println("endpoint status:", health.Status)

    ledger, err := client.GetLatestLedger(ctx)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("latest ledger:  %d (protocol %d)\n", ledger.Sequence, ledger.ProtocolVersion)
}
API Reference

Supported RPC Methods

Stellar RPC Method Client Method CLI Command
getHealth GetHealth sorobango health
getLatestLedger GetLatestLedger sorobango latest-ledger
getLedgerEntries GetLedgerEntries sorobango ledger-entries
simulateTransaction SimulateTransaction sorobango simulate
GetContractData* GetContractData sorobango contract-data
GetContractInstance* GetContractInstance sorobango contract-instance

* Helper methods built on top of getLedgerEntries for easier contract state reading

Build on Stellar with Go

Join the growing Stellar ecosystem. Start building powerful backend services, indexers, and infrastructure today.