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
# npmnpm install @empyrealm/sdk# yarnyarn add @empyrealm/sdk# pnpmpnpm 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 clientconst 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 chainconst info = await client.getChainInfo();console.log('Block height:', info.blockHeight);// 5. Get your balanceconst balance = await client.getBalance();console.log('Balance:', balance);}main().catch(console.error);
Get Testnet Tokens
Claim free tokens from the faucet:
typescript
// Claim testnet tokensconst result = await client.claimFaucet();console.log('Claimed:', result.amount, 'RLM');// Check updated balanceconst 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 Exchangeawait client.deposit({token: 'RLM',amount: 1000, // 1000 RLM});// Check exchange balanceconst balance = await client.getBalance();console.log('RLM Exchange:', balance.rlmExchange);
Place an Order
Submit your first trade:
typescript
// Place a limit orderconst 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
- First Trade — Complete trading tutorial
- API Reference — Full endpoint documentation
- TypeScript SDK — Complete SDK guide
- Order Types — Stop orders, TP/SL, trailing stops