synor/sdk/go
Gulshan Yadav 59a7123535 feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage
Implements comprehensive SDK support for three core services across
four programming languages (JavaScript/TypeScript, Python, Go, Rust).

## New SDKs

### Wallet SDK
- Key management (create, import, export)
- Transaction signing
- Message signing and verification
- Balance and UTXO queries
- Stealth address support

### RPC SDK
- Block and transaction queries
- Chain state information
- Fee estimation
- Mempool information
- WebSocket subscriptions for real-time updates

### Storage SDK
- Content upload and download
- Pinning operations
- CAR file support
- Directory management
- Gateway URL generation

## Shared Infrastructure

- JSON Schema definitions for all 11 services
- Common type definitions (Address, Amount, UTXO, etc.)
- Unified error handling patterns
- Builder patterns for configuration

## Package Updates

- JavaScript: Updated to @synor/sdk with module exports
- Python: Updated to synor-sdk with websockets dependency
- Go: Added gorilla/websocket dependency
- Rust: Added base64, urlencoding, multipart support

## Fixes

- Fixed Tensor Default trait implementation
- Fixed ProcessorType enum casing
2026-01-27 00:46:24 +05:30
..
rpc feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage 2026-01-27 00:46:24 +05:30
storage feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage 2026-01-27 00:46:24 +05:30
wallet feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage 2026-01-27 00:46:24 +05:30
go.mod feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage 2026-01-27 00:46:24 +05:30
README.md docs(sdk): add comprehensive documentation for all 12 SDKs 2026-01-11 18:05:03 +05:30
synor.go feat(sdk): add consumer SDKs for JavaScript, Python, and Go 2026-01-11 14:11:58 +05:30
synor_test.go test(sdk): add comprehensive unit tests for all SDKs 2026-01-11 17:56:11 +05:30

Synor Compute SDK for Go

Access distributed heterogeneous compute at 90% cost reduction.

Installation

go get github.com/synor/compute-sdk-go

Quick Start

package main

import (
    "context"
    "fmt"
    "log"

    synor "github.com/synor/compute-sdk-go"
)

func main() {
    client := synor.NewClient("your-api-key")

    // Create tensors
    a := synor.NewTensor(data, []int{512, 512}, synor.FP32)
    b := synor.Zeros([]int{512, 512}, synor.FP32)

    // Matrix multiplication
    ctx := context.Background()
    result, err := client.MatMul(ctx, a, b,
        synor.WithPrecision(synor.FP16),
        synor.WithProcessor(synor.GPU),
    )
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("Execution time: %.2fms\n", result.Metrics.ExecutionTimeMs)
}

Configuration

config := synor.Config{
    APIKey:    "your-api-key",
    Endpoint:  "https://api.synor.io/compute/v1",
    Strategy:  synor.Balanced,
    Precision: synor.FP16,
    Timeout:   30 * time.Second,
}

client := synor.NewClientWithConfig(config)

Tensor Operations

// Create tensors
zeros := synor.Zeros([]int{3, 3}, synor.FP32)
ones := synor.Ones([]int{2, 2}, synor.FP32)

// From slice
data := []float32{1, 2, 3, 4, 5, 6}
tensor := synor.NewTensor(data, []int{2, 3}, synor.FP32)

// Serialize for API
serialized := tensor.Serialize()

Matrix Operations

// Matrix multiplication
result, err := client.MatMul(ctx, a, b,
    synor.WithPrecision(synor.FP16),
    synor.WithProcessor(synor.GPU),
    synor.WithStrategy(synor.Speed),
)

// 2D Convolution
conv, err := client.Conv2D(ctx, input, kernel,
    synor.WithStride(1, 1),
    synor.WithPadding(1, 1),
)

// Attention
attention, err := client.Attention(ctx, query, key, value,
    synor.WithNumHeads(8),
    synor.WithFlash(true),
)

LLM Inference

// Single response
response, err := client.Inference(ctx, "llama-3-70b", "Explain quantum computing",
    synor.WithMaxTokens(512),
    synor.WithTemperature(0.7),
)
fmt.Println(response.Result)

// Streaming (using channel)
stream, err := client.InferenceStream(ctx, "llama-3-70b", "Write a poem")
for chunk := range stream {
    fmt.Print(chunk)
}

Job Management

// Submit async job
job, err := client.SubmitJob(ctx, "matmul", map[string]interface{}{
    "a": a.Serialize(),
    "b": b.Serialize(),
})

// Get status
status, err := client.GetJobStatus(ctx, job.ID)

// Cancel
err = client.CancelJob(ctx, job.ID)

Error Handling

result, err := client.MatMul(ctx, a, b)
if err != nil {
    if synorErr, ok := err.(*synor.SynorError); ok {
        fmt.Printf("API Error: %s (status: %d)\n",
            synorErr.Message, synorErr.StatusCode)
    }
}

Processor Types

synor.CPU     // General-purpose CPU
synor.GPU     // NVIDIA/AMD GPU
synor.TPU     // Google TPU
synor.NPU     // Neural Processing Unit
synor.LPU     // Language Processing Unit
synor.FPGA    // Field-Programmable Gate Array
synor.WASM    // WebAssembly runtime
synor.WebGPU  // Browser GPU

Precision Levels

synor.FP64  // 64-bit float
synor.FP32  // 32-bit float (default)
synor.FP16  // 16-bit float
synor.BF16  // Brain float 16
synor.INT8  // 8-bit integer
synor.INT4  // 4-bit integer

Testing

go test ./...

License

MIT