@anomaly-foundation/sdk
v0.0.12
Published
Anomaly JS Client.
Readme
Anomaly JS/TS SDK
Official JavaScript/TypeScript client SDK for The Bridge program on Solana. This package provides type-safe interfaces and utilities for interacting with the Anomaly program from web applications and Node.js.
Overview
The SDK provides complete client-side functionality for The Bridge game, including transaction builders, account helpers, PDA derivation, and type-safe data encoding/decoding.
Installation
npm install @anomaly-foundation/sdk
# or
pnpm add @anomaly-foundation/sdk
# or
yarn add @anomaly-foundation/sdkUsage Examples
Initialize User
import { initializeUser, getUserPDA } from '@anomaly-foundation/sdk';
// Getting a PDA
const [userPDA] = getUserPDA(userAddress);
// Construct an instruction
const instruction = initializeUser(userAddress);Decode Account Data
import { getRoomCodec } from '@anomaly-foundation/sdk';
const roomCodec = getRoomCodec();
const roomData = roomCodec.decode(accountData);
console.log('Game round:', roomData.round);
console.log('Players:', roomData.players);
console.log('Winner:', roomData.winner);Development
# Install dependencies
pnpm install
# Build the library
pnpm build
# Run tests
pnpm test
# Type checking
pnpm typecheck
# Linting
pnpm lint
# Format code
pnpm formatBuilt With
- Gill - Solana client library
License
MIT
