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.
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.
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.
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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| creatureId | string | Yes | The unique on-chain token ID of the creature (e.g. "voltora-001"). |
| xp | number | No | New absolute experience point count. Defaults to current value. |
| level | number | No | Target level (1 - 50 range limit). Defaults to current value. |
| wins | number | No | Total cumulative battle wins. Used for base stat adjustments. |
await pokeforge.updateStats({
creatureId: "voltora-001",
xp: 240,
level: 10,
wins: 4,
evolutionStage: 2,
});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).
| Parameter | Type | Required | Description |
|---|---|---|---|
| creatureId | string | Yes | On-chain token ID of your active creature. |
| challengerId | string | Yes | Token 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);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).
| Parameter | Type | Required | Description |
|---|---|---|---|
| creatureId | string | Yes | Token ID of the creature undergoing evolution. |
| targetStage | number | Yes | The 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);