SDK Overview
Omne provides production-ready SDKs for Python, Go, and TypeScript/JavaScript. All SDKs offer the same comprehensive feature set with language-specific optimizations.
Available SDKs
TypeScript/JavaScript
@omne/sdk
Full-featured SDK for Node.js and browser environments with TypeScript support.
Python
omne-sdk
Production-ready Python SDK with async/await support and comprehensive type hints.
Go
omne-go-sdk
High-performance Go SDK optimized for concurrent applications and microservices.
Common Features
All Omne SDKs provide a consistent API surface with the following core features:
Account Management
Create, import, and manage Omne accounts with full key control
Transaction Building
Construct, sign, and broadcast transactions with ease
Smart Contract Interaction
Deploy and interact with smart contracts seamlessly
Network Querying
Query blockchain state, balances, and transaction history
Real-time Events
Subscribe to blockchain events and transaction updates
Fee Management
Automatic fee estimation and custom fee configuration
Error Handling
Comprehensive error types and retry mechanisms
Testing Utilities
Mock clients and test helpers for development
Quick Examples
Basic Transaction (TypeScript)
import { OmneClient } from '@omne/sdk'
const client = new OmneClient({
network: 'testnet',
endpoint: 'https://testnet-rpc.omne.foundation'
})
// Send transaction
const txHash = await client.transfer({
from: 'omne1your-address',
to: 'omne1recipient-address',
amount: '1000000', // 1 OMNE
fee: 'auto' // Automatic fee estimation
})
console.log('Transaction sent:', txHash)
Account Balance Check (Python)
from omne_sdk import OmneClient
client = OmneClient(
network='testnet',
endpoint='https://testnet-rpc.omne.foundation'
)
# Get balance
balance = await client.get_balance('omne1your-address')
print(f'Balance: {balance.amount} OMNE')
# Get transaction history
history = await client.get_transaction_history(
address='omne1your-address',
limit=10
)
for tx in history.transactions:
print(f'{tx.hash}: {tx.amount} OMNE')
Smart Contract Call (Go)
package main
import (
"context"
"log"
"github.com/omne-foundation/omne-go-sdk/client"
)
func main() {
client, err := client.NewOmneClient(&client.Config{
Network: "testnet",
Endpoint: "https://testnet-rpc.omne.foundation",
})
if err != nil {
log.Fatal(err)
}
// Call smart contract
result, err := client.CallContract(context.Background(), &client.ContractCall{
Address: "omne1contract-address",
Method: "get_balance",
Args: []interface{}{"omne1user-address"},
})
if err != nil {
log.Fatal(err)
}
log.Printf("Contract result: %v", result)
}
Installation & Setup
TypeScript/JavaScript
# Install via npm
npm install @omne/sdk
# Install via yarn
yarn add @omne/sdk
# Install via pnpm
pnpm add @omne/sdk
Python
# Install via pip
pip install omne-sdk
# Install with async support
pip install omne-sdk[async]
# Install development version
pip install git+https://github.com/omne-foundation/omne-python-sdk.git
Go
# Install via go get
go get github.com/omne-foundation/omne-go-sdk
# Add to go.mod
go mod tidy