Quick Start

Get up and running with Realm in under 5 minutes. This guide covers installation, wallet creation, and your first trade.

Prerequisites

  • Node.js 18+ (for TypeScript SDK)
  • A code editor
  • Internet connection

Installation

Install the Realm SDK using your preferred package manager:

bash
# npm
npm install @empyrealm/sdk
# yarn
yarn add @empyrealm/sdk
# pnpm
pnpm add @empyrealm/sdk

TypeScript Support

The SDK is written in TypeScript and includes full type definitions. No additional @types packages needed.

Basic Usage

Here's a complete example to connect to Realm:

index.tstypescript
import { RealmClient, RealmWallet } from '@empyrealm/sdk';
async function main() {
// 1. Create a client
const client = new RealmClient('https://api.realm.software');
// 2. Generate a new wallet (or restore from seed)
const wallet = await RealmWallet.generate();
console.log('Address:', wallet.address);
// 3. Connect (authenticates all future requests)
await client.connect(wallet);
// 4. Check the chain
const info = await client.getChainInfo();
console.log('Block height:', info.blockHeight);
// 5. Get your balance
const balance = await client.getBalance();
console.log('Balance:', balance);
}
main().catch(console.error);

Get Testnet Tokens

Claim free tokens from the faucet:

typescript
// Claim testnet tokens
const result = await client.claimFaucet();
console.log('Claimed:', result.amount, 'RLM');
// Check updated balance
const balance = await client.getBalance();
console.log('RLM L1:', balance.rlmL1);
console.log('USDC L1:', balance.usdcL1);

Faucet Limits

The faucet is rate-limited to prevent abuse. You can claim once every 24 hours per address.

Deposit to Exchange

Move tokens from L1 to the exchange for trading:

typescript
// Deposit RLM from L1 to Exchange
await client.deposit({
token: 'RLM',
amount: 1000, // 1000 RLM
});
// Check exchange balance
const balance = await client.getBalance();
console.log('RLM Exchange:', balance.rlmExchange);

Place an Order

Submit your first trade:

typescript
// Place a limit order
const order = await client.placeOrder({
market: 'RLM-PERP',
side: 'buy',
type: 'limit',
price: 100.00,
size: 1.0,
timeInForce: 'GTC', // Good-Till-Cancel
});
console.log('Order ID:', order.orderId);
console.log('Status:', order.status);

Next Steps