SDK Docs

Explore the API specification, Solana config, state mutators, and battle handlers.

01. Program Registry

The official POKEFORGE smart contract deployed on the Solana blockchain network. Verify client transactions, explore program instructions, or track state mutations directly on the ledger.

Solana Program ID (Contract Address)PKFG5fW27ajoKTp27bqz8uiUTSWZEB5UGhfLW5HwFof

02. Installation

Add the official POKEFORGE TypeScript SDK to your web application or Game Engine project. The bundle includes client helpers, Anchor wrappers, cryptographic program interfaces, and element calculation utilities.

$npm install @pokeforge/sdk
Installs package to your package.jsonView on npmjs.com →

03. Quickstart Guide

Instantiate the PokeForgeSDK. Specify the cluster endpoint and supply a signing wallet adapter (or private keypair) to sign and broadcast state modifications to the Solana ledger.

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

// Set up Solana Connection and Keypair
const connection = new Connection("https://api.mainnet-beta.solana.com");
const trainerKeypair = Keypair.fromSecretKey(/* private_key_uint8 */);

// Initialize POKEFORGE SDK wrapper
const pokeforge = new PokeForgeSDK({
  cluster: "mainnet-beta",
  connection,
  wallet: trainerKeypair,
});

console.log("POKEFORGE SDK initialized successfully.");

Make sure you have pre-funded your Solana wallet with Devnet or Mainnet SOL before submitting transactions. Standard network transaction fees apply to state updates.

MUTATOR API

pokeforge.updateStats()

Submits a mutation update to the metadata PDA (Program Derived Address) on-chain. This will adjust the level, total XP, wins, and evolution stage of the target creature. Base combat stats (HP, ATK, DEF, SPD) are recalculated on-chain dynamically based on these values.

ParameterTypeRequiredDescription
creatureIdstringYesThe unique on-chain token ID of the creature (e.g. "voltora-001").
xpnumberNoNew absolute experience point count. Defaults to current value.
levelnumberNoTarget level (1 - 50 range limit). Defaults to current value.
winsnumberNoTotal cumulative battle wins. Used for base stat adjustments.
await pokeforge.updateStats({
  creatureId: "voltora-001",
  xp: 240,
  level: 10,
  wins: 4,
  evolutionStage: 2,
});
BATTLE API

pokeforge.simulateBattle()

Executes a deterministic battle algorithm locally or on-chain. Compares combat speeds, elemental affinities, levels, and attack vectors of the user creature and challenger. Returns transaction logs and calculated rewards (XP earned, win count updates).

ParameterTypeRequiredDescription
creatureIdstringYesOn-chain token ID of your active creature.
challengerIdstringYesToken ID of the challenger opponent creature.
const result = await pokeforge.simulateBattle({
  creatureId: "voltora-001",
  challengerId: "pyrogone-003",
});

console.log("Winner ID:", result.winnerId);
console.log("Total XP Earned:", result.xpEarned);
console.log("Battle Rounds:", result.rounds);
EVOLUTION API

pokeforge.evolveCreature()

Triggers an evolution on-chain once XP requirements are fulfilled. The SDK coordinates with the smart contract to burn the old creature token, mint the evolved tier NFT, copy over persistent history stats, and release a permanent base combat stat upgrade (+20 baseline).

ParameterTypeRequiredDescription
creatureIdstringYesToken ID of the creature undergoing evolution.
targetStagenumberYesThe targeted evolution stage index (can be Stage 2 or Stage 3).
const evolutionResult = await pokeforge.evolveCreature({
  creatureId: "voltora-001",
  targetStage: 2,
});

console.log("Evolved Creature Mint:", evolutionResult.newMintAddress);