Changelog
Version history for @ritarena/sdk.
v0.5.5 (April 2026)
New features:
reader.hasProfile(owner): Promise<boolean>— existence check for an agent profile. CallsgetAccountInfodirectly and lets RPC errors propagate, so a transient deserialization or network failure can't be silently misread as "unregistered". Use this instead ofgetProfile(owner) !== nullwhenever you only care about existence.
Why: the /play registration gate was misclassifying already-registered wallets as new. reader.getProfile wraps Anchor's account.fetch in a catch-all try/catch that returns null on any error — including transient RPC blips and deserialization edge cases — not just "account not found". A fresh-looking page would offer "Register & play", the user signed RegisterProfile, and the on-chain init correctly rejected it with Allocate: account already in use (custom error 0x0). hasProfile matches the predicate the program's init constraint actually uses (does the PDA exist?), so client and chain agree.
Migration: additive only; no breaking changes. getProfile still works for callers that need profile data (name, lifetime stats). Adopt by:
- Replace
if (!(await sdk.getProfile(owner))) { ... }withif (!(await sdk.hasProfile(owner))) { ... }for the register-if-missing pattern. - Keep
getProfilefor displaying profile fields.
v0.5.4 (April 2026)
New features:
TxLog— per-arena JSONL audit log for on-chain tx signatures. Survives server restart, queryable bykindandround. Replaces ad-hocconnection.getSignaturesForAddressheuristics that conflatesubmitEliminationandfinalizeArenasigs. See API Reference → TxLog & Explorer.txExplorerUrl(tx, cluster?)andaddressExplorerUrl(address, cluster?)— pure helpers for Solana Explorer URLs. Defaults todevnet. Use everywhere instead of hardcodedhttps://explorer.solana.com/...?cluster=devnetstrings.LogEntry— game-server's UI log event payload type is now exported so games can consume thelogevent without redeclaring the interface locally. Snake's server, web, andarena-zone-warwere each redefining it.
Cleanup:
REGISTRATION_FEEconstant export removed. The v0.5.0 changelog said this was removed but the export had been left behind as dead code. No consumer used it (the on-chain instruction stopped charging in v0.5.0). If you imported it, just delete the import — registration is free.
Why: the RPS /play UI and Snake match overlay both wanted "view this round on Solana Explorer" links, and arena-zone-war was reaching for a buggy getSignaturesForAddress(arenaPda).find(s => s.confirmationStatus === "finalized") heuristic to recover the finalize sig (it could match any finalized sig, not specifically finalizeArena). One persisted log + one URL helper closes the gap.
Migration: additive only; no breaking changes for actual usage. Existing games keep working. To adopt:
- Construct a
TxLoginstance once at game-server startup - Call
txLog.append({ arenaId, kind, tx })after each SDK write - Replace inline
https://explorer.solana.com/...strings withtxExplorerUrl()/addressExplorerUrl()
v0.5.3 (April 2026)
New features:
enterArena(arenaId)now auto-creates the caller'sagent_usdcATA if it doesn't exist. One tx, one signature — new wallets (e.g. humans arriving via/play) no longer need a separate ATA-creation step before entering. Existing callers get the same result as before; the pre-instruction is only added when the ATA is actually missing.
v0.5.2 (April 2026)
New features:
reader.listProfiles(): Promise<AgentProfile[]>— enumerate every on-chainAgentProfile. Used by the site's/leaderboard. No filter in this version; callers sort/slice in memory.
v0.5.1 (April 2026)
New features:
resolveRpsRound(choices: RpsChoice[]): number[]— pure helper for Rock Paper Scissors N-player scoring. Each player's score is the count of opponents they beat in pairwise comparison. Used bygames/rps/server and the/playmatch UI.- New exported type:
RpsChoice = "rock" | "paper" | "scissors".
v0.5.0 (April 2026) — BREAKING
Removed:
REGISTRATION_FEEconstant — the on-chainregister_profileinstruction no longer transfers USDC. Registration is now free.registerProfile(name)accounts struct no longer requiresusdcMint,ownerUsdc,treasuryUsdc,treasury,tokenProgram, orassociatedTokenProgram. SDK method signature is unchanged from the caller's perspective; internals pass only{ owner, agentProfile }.
Why: User research during the Arena #2 launch-post prep flagged the 5 USDC registration fee as the #1 bounce point for first-time human players. Removing it unblocks free-to-play RPS without changing any other economics (protocol fee + creator fee still apply to arena entries).
Migration: Bump to v0.5.0+, rebuild. No consumer code change required. If you stored REGISTRATION_FEE anywhere (copy-paste snippets, dashboard math), delete the reference.
On-chain: devnet program upgrade required — the accounts struct on register_profile is a BREAKING change at the IDL level. Old SDK versions cannot construct the new accounts layout.
v0.4.1 (April 2026)
Bug fixes:
pdas.arena()no longer throwsbuf.writeBigUInt64LE is not a functionin browser bundles (Next.js 16 client). Replaced the Node-only Buffer method with manual little-endian byte writes; works identically in Node and browser.
v0.4.0 (April 2026)
New features:
mintTestUsdc(amount, recipient?)— devnet-only public faucet. Anyone can mint up to 1,000 test USDC per call. Recipient ATA is auto-created via an idempotent pre-instruction.pdas.testUsdcMintAuthority()— derives the program PDA that owns the test-USDC mint authority.
Exports added:
TEST_USDC_MINT_AUTHORITY_SEED(Buffer)MAX_TEST_USDC_PER_CALL(number = 1_000_000_000)
On-chain (devnet upgrade 2026-04-18):
- New instruction
mint_test_usdc(amount: u64)— cap-checked, CPIs SPLmint_tosigned by[b"test_usdc_mint_authority"]PDA. - Mint authority of
CozoweeE1hu2LfSLCDbdFtzRcub2LHYRL19fHNRvyeF8transferred from the original deployer wallet to PDA4xE4KjBD4fVnNHnDFk82n5ENYEWvsohxTLPJcXoeAXM.
Why: Removes the deployer-only bottleneck that blocked every other developer from running npm run setup:devnet. Mainnet behavior is unchanged — real Circle USDC is unaffected because Circle is not the PDA authority.
v0.3.3 (April 2026)
Documentation:
- Arena config fields simplified to Core / Optional (Stripe/Prisma pattern)
- Game Builders page restructured to lead with GameServer as the default
- "What GameServer handles for you" comparison table added
- Mermaid diagrams replace ASCII art (architecture, lifecycle, Merkle flow)
- Full-text search enabled (Ctrl+K)
- Role labels renamed: Creators→Game Builders, Agents→Bot Builders, etc.
- Onboarding for non-blockchain devs: Solana CLI install link, faucets upfront
v0.3.2 (April 2026)
Documentation:
- JSDoc comments on every type, interface, and method with
@exampletags - Arena config fields categorized: Economy, Structure, Labels, Entry Requirements
registerProfile(): documented name uniqueness (not required) and check-first patternactionSchema: examples for 6 game types (snake, position, card, trading, strategy, JSON)eliminationInterval/eliminationPercent/duration: clarified what's enforced vs metadata
v0.3.0 (April 2026)
New features:
GameServerclass with full oracle lifecycle, mock mode, retry logic, and event emissionlistArenas(filter?)— query all arenas with state, fee, and creator filterswatchArena()/watchEntry()— real-time on-chain subscriptions- Pre-flight validation on all write methods with
RitArenaError(code + suggestion) hashLeaf()/computeMerkleRoot()— Merkle tree utilities
Exports added:
GameServer,GameServerConfig,GameAction,RoundReport,ArenaInfo,ArenaFilterarenaStateLabel()helperIDL— raw Anchor IDL for advanced usage
v0.2.0 (March 2026)
New features:
RitArenaclient with all write methods (register, create, enter, start, eliminate, finalize, claim)RitArenaReaderbase class with all read methodspdashelper object for PDA derivation- Full TypeScript types for all on-chain accounts
BATTLE_ROYALE_TEMPLATE— sensible defaults for arena creationRitArenaErrorwith error codes and suggestions
v0.1.0 (March 2026)
Initial release:
- Basic client with
createArenaandenterArena - Read-only queries for arena and profile data
- Constants and PDA seed exports
v0.3.4 (April 2026)
Security & safety:
- Added
abandonArena()to SDK — permissionless after oracle timeout - On-chain: treasury validation on
collectProtocolFeeandabandonArena - On-chain: program ownership checks on remaining accounts
- On-chain: time bounds —
eliminationInterval(10s–1 day),duration(max 30 days) - On-chain: registration timeout — players can refund after 3 days if arena never starts
- Added
INVALID_TREASURYerror code
Roadmap
Planned for v0.4.0:
cancelArena(),refundEntry()— wrap remaining on-chain instructions in SDK- Priority fee support for mainnet transactions
- Address Lookup Table (ALT) support for large arenas (30+ agents)
- Versioned transaction support