First Transaction
This guide walks through submitting a signed OMC transfer to the Omne blockchain.
Prerequisites
- SDK installed (
@omne/sdk) — see Installation - A wallet with a funded account — see Fund from Faucet
- Access to an RPC endpoint (Ignis devnet:
wss://rpc.ignis.omnechain.network)
Connect to the network
import { Wallet, OmneClient, createClient } from '@omne/sdk'
// Connect directly to the live Ignis devnet by URL
const client = new OmneClient('wss://rpc.ignis.omnechain.network')
// Or, if running a local node:
const local = createClient('primum') // ws://localhost:8545 — local dev role
// const testnet = createClient('testum') // Testum testnet (not yet live)
// const mainnet = createClient('principalis') // Primum mainnet (not yet live)Naming note: The SDK’s createClient(role) factory uses environment-role keys — primum (local dev), testum (testnet), principalis (mainnet). These are distinct from the deployed-network codenames — Ignis (devnet, live), Testum (testnet, forming), Primum (mainnet, upcoming). To connect to the live Ignis devnet, construct the client directly with its RPC URL as shown above.
Check your balance
const wallet = Wallet.fromMnemonic('your twelve word mnemonic ...')
const account = wallet.getAccount(0)
const balance = await client.getBalance(account.address)
console.log(`Balance: ${balance.balanceOMC} OMC`)
// → "Balance: 100.000000000000000000 OMC"Quar precision: 1 OMC = 10¹⁸ Quar. The SDK handles conversion automatically — use balanceOMC for display and balanceQuar for arithmetic.
Send a transfer
The transfer method constructs, signs, and submits a transaction in one call:
const receipt = await client.transfer({
from: account.address,
to: 'omne1recipient...',
valueOMC: '1.5', // 1.5 OMC
gasLimit: 21000, // default for simple transfer
gasPriceQuar: '1000', // microscopic fee
})
console.log('Transaction ID:', receipt.transactionId)
console.log('Block:', receipt.blockHeight)
console.log('Status:', receipt.status)Manual transaction construction
For more control, construct and sign the transaction yourself:
// Get the current nonce
const nonce = await client.getTransactionCount(account.address)
// Estimate gas
const gasEstimate = await client.estimateGas({
from: account.address,
to: 'omne1recipient...',
value: '1500000000000000000', // 1.5 OMC in Quar
})
// Build and sign
import { toQuar } from '@omne/sdk'
const tx = {
from: account.address,
to: 'omne1recipient...',
value: toQuar('1.5'), // Convert OMC → Quar string
gasLimit: gasEstimate,
gasPrice: '1000',
nonce,
}
const signed = account.signTransaction(tx)
// Submit the signed transaction
const receipt = await client.sendTransaction(signed)Wait for confirmation
const receipt = await client.waitForTransaction(txHash, 30000)
// Waits up to 30 seconds for block inclusion
if (receipt.status === 'success') {
console.log('Confirmed in block', receipt.blockHeight)
}Fee estimation
const fees = await client.estimateFees({
from: account.address,
to: 'omne1recipient...',
value: toQuar('10'),
})
console.log('Estimated fee:', fees)Omne’s fee model targets microscopic costs — a typical transfer costs roughly 0.000001 OMC.
Transaction priority
Omne’s dual-layer consensus processes transactions at different cadences:
| Priority | Layer | Finality |
|---|---|---|
commerce | Commerce | ~3 seconds |
standard | Commerce | ~3 seconds |
security | Security | ~9 minutes |
await client.transfer({
from: account.address,
to: 'omne1recipient...',
valueOMC: '1.0',
priority: 'commerce', // Fast finality
})Error handling
import { TransactionError, NetworkError } from '@omne/sdk'
try {
const receipt = await client.transfer({ ... })
} catch (error) {
if (error instanceof TransactionError) {
console.error('Transaction failed:', error.message)
} else if (error instanceof NetworkError) {
console.error('Network unreachable:', error.message)
}
}Verify on the block explorer
After the transaction lands, verify it on the Omne block explorer:
https://omnescan.com/tx/<transactionId>Or check the account balance changed:
https://omnescan.com/address/<your-address>What’s next?
- Deploy an ORC-20 token
- Run your own node
- Explore the full JSON-RPC API
- Browse working example snippets