SDK ReferenceOverview

SDK Reference

The @omne/sdk is the official TypeScript/JavaScript SDK for the Omne blockchain. It provides everything needed to build applications that interact with the network: wallet generation, transaction signing, RPC communication, token management, and contract deployment.

Install

npm install @omne/sdk

Package overview

ExportPurpose
WalletBIP39 mnemonic generation, SLIP-0010 ed25519 HD derivation
WalletAccountIndividual account keypair with signing methods
WalletManagerMulti-wallet orchestration
OmneClientJSON-RPC client (HTTP, WebSocket) for all blockchain operations
OmneContractContract interaction abstraction
createClient()Factory for named network connections
UtilitiesAddress validation, balance formatting, gas estimation, signature verification
Error classesTyped errors: TransactionError, NetworkError, WalletError, RPCError, etc.

Quick start

import { Wallet, OmneClient } from '@omne/sdk'
 
// Generate a wallet
const wallet = Wallet.generate()
const account = wallet.getAccount(0)
console.log('Address:', account.address) // omne1...
 
// Connect to the network
const client = new OmneClient('http://localhost:9944')
 
// Check balance
const balance = await client.getBalance(account.address)
console.log(`${balance.balanceOMC} OMC`)
 
// Transfer OMC
const receipt = await client.transfer({
  from: account.address,
  to: 'omne1recipient...',
  valueOMC: '1.0',
})
console.log('Tx:', receipt.transactionId)

Supported environments

EnvironmentSupport
Node.js 18+Full (native fetch)
Node.js 16–17Full (requires node-fetch polyfill)
Chrome 80+Full
Firefox 80+Full
Safari 14+Full
Edge 80+Full
React NativeVia setPlatformProviders()
Cloudflare WorkersVia setPlatformProviders()

Build targets

The SDK ships four build outputs:

TargetPathUse case
CJSdist/cjs/Node.js require()
ESMdist/esm/Modern bundlers, import
Browserdist/browser/Direct browser imports
Typesdist/types/TypeScript declarations