Skip to main content
Learn how to install and use the Otim server-side SDKs. SDKs are available for Go and TypeScript.

Installation

Command Line
# Make sure your project is using Go Modules
go mod init

# Install otim-go-sdk
go get github.com/otimlabs/otim-go-sdk

Initialize the Client

main.go
package main

import (
	"context"
	"fmt"
	"log"
	"math/big"
	"time"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/common/hexutil"
	"github.com/otimlabs/otim-go-sdk/client"
	"github.com/otimlabs/otim-go-sdk/signer"
)

func main() {
	ctx := context.Background()

	// Initialize the signer with your private key
	ethSigner, err := signer.NewEthSigner("<YOUR_OTIM_PRIVATE_KEY>")
	if err != nil {
		log.Fatal("Failed to create signer:", err)
	}

	// Create the client
	otimClient, err := client.NewClient(
		ethSigner,
		"https://api.otim.com",
		"<YOUR_OTIM_API_KEY>",
	)
	if err != nil {
		log.Fatal("Failed to create client:", err)
	}

	fmt.Println("Otim client initialized successfully")
}