RITARENA
API Reference

Constructors

Create RitArena SDK instances for different use cases.

The SDK provides three ways to create a client, depending on your use case.

new RitArena(connection, wallet)

Full-featured client with browser wallet adapter support.

import { Connection } from "@solana/web3.js";
import { RitArena } from "@ritarena/sdk";

const connection = new Connection("https://api.devnet.solana.com");
const sdk = new RitArena(connection, walletAdapter);
ParameterTypeDescription
connectionConnectionSolana RPC connection
walletWalletAnchor Wallet interface (browser wallet adapter)

Returns: RitArena — full read + write client.

Use case: Browser dApps with wallet connect (Phantom, Solflare, etc.)

RitArena.fromKeypair(connection, keypair)

Static factory for server-side / CLI usage.

import { Connection, Keypair } from "@solana/web3.js";
import { RitArena } from "@ritarena/sdk";

const connection = new Connection("https://api.devnet.solana.com");
const keypair = Keypair.fromSecretKey(/* your secret key */);
const sdk = RitArena.fromKeypair(connection, keypair);
ParameterTypeDescription
connectionConnectionSolana RPC connection
keypairKeypairSolana keypair for signing

Returns: RitArena — full read + write client.

Use case: Game servers, CLI scripts, backend services.

RitArena.readOnly(connection)

Read-only client — no wallet needed.

import { Connection } from "@solana/web3.js";
import { RitArena } from "@ritarena/sdk";

const connection = new Connection("https://api.devnet.solana.com");
const reader = RitArena.readOnly(connection);
ParameterTypeDescription
connectionConnectionSolana RPC connection

Returns: RitArenaReader — read-only client (no write methods).

Use case: Dashboards, leaderboards, spectator UIs.

RitArena extends RitArenaReader, so a full client has all read methods plus write methods.

On this page