Skip to content

Go SDK

Installation

go get github.com/sarna-technologies/go-sarna

Quick Start

package main

import (
    "context"
    sdk "github.com/sarna-technologies/go-sarna"
)

func main() {
    client := sdk.New(
        sdk.WithBearerAuth("sandbox_test_xxxx12345"),
        sdk.WithServerURL("https://api.sandbox.sarna.io"),
    )
    ctx := context.Background()

    // Get a quote
    quote, _ := client.MarketData.GetQuote(ctx, "AAPL")

    // Place an order
    order, _ := client.Orders.PlaceOrder(ctx, sdk.PlaceOrderRequest{
        AccountID: 500123, Symbol: "AAPL", Quantity: 100,
    })
}

Features

  • Context support on all methods
  • Structured errors
  • Go modules with proper go.mod
  • Automatic retry with exponential backoff