Overview
Build at light speed.
HyperOvsm is a hyper-performant L1 with an onchain orderbook, native HyperEVM, and sub-second finality. This quickstart gets you fetching blocks and submitting your first transaction in under five minutes.
Consensus
HyperBFT, 0.3s finality
Throughput
200,000 TPS sustained
Execution
HyperEVM, parallelized
Fees
Gasless trading
SDK Quickstart
The official TypeScript SDK works in Node, Bun, Deno, and the browser. Every snippet below is copy-paste ready — hover a block to reveal the copy button.
1. Install
bash
# bun (recommended) bun add @hyperovsm/sdk # npm npm install @hyperovsm/sdk # pnpm pnpm add @hyperovsm/sdk
2. Initialize the client
ts
import { createClient } from "@hyperovsm/sdk";
export const client = createClient({
network: "mainnet", // or "testnet"
rpcUrl: "https://rpc.hyperovsm.xyz",
apiKey: process.env.HYPEROVSM_KEY, // optional, for higher rate limits
});3. Fetch a block
Block data is available milliseconds after consensus. The streaming API yields a block per round.
ts
// Fetch the latest block
const latest = await client.getBlock("latest");
console.log(latest.height, latest.hash, latest.txCount);
// Fetch by height
const block = await client.getBlock(1_234_567);
// Stream new blocks as they finalize (sub-second)
for await (const b of client.streamBlocks()) {
console.log("finalized", b.height, "in", b.finalityMs, "ms");
}4. Submit a transaction
Build, sign locally, and broadcast. Pass { wait: true } to resolve only after the tx is finalized.
ts
import { Wallet, encodeOrder } from "@hyperovsm/sdk";
const wallet = Wallet.fromPrivateKey(process.env.PRIVATE_KEY!);
// Build a limit order on the ETH-USD orderbook
const tx = await client.buildTransaction({
to: "HyperRouter",
fn: "placeOrder",
args: encodeOrder({
market: "ETH-USD",
size: "0.5", // long 0.5 ETH
price: "3450.00", // limit price
}),
});
// Sign locally, broadcast, await inclusion
const signed = await wallet.sign(tx);
const receipt = await client.submitTransaction(signed, { wait: true });
console.log(receipt.hash, receipt.status, receipt.gasUsed);5. Handle errors
ts
import { HyperovsmError } from "@hyperovsm/sdk";
try {
await client.submitTransaction(signed);
} catch (err) {
if (err instanceof HyperovsmError) {
console.error(err.code, err.message); // e.g. "INSUFFICIENT_MARGIN"
}
throw err;
}