xsolana

io.github.XGamesFun由 GitHub 帳號 XGamesFun 發布v0.20.1更新於 Oct 30, 2026

Design, check, simulate and launch Solana game economies on loot, one shared program, no contract.

概覽

AI 產生的概覽

以 JSON 規格而非自寫智慧合約,在共用的 loot 程式上設計、檢查、模擬並準備上線 Solana 遊戲經濟系統。

可以做什麼
  • 閱讀指南並尋找商店、盲盒、抽獎、拍賣、質押農場、合成等經濟系統的現成範例
  • 檢查經濟規格中的拒絕項目與警告,並模擬預期回報、莊家優勢與資金池收支
  • 估算上線成本與每個動作的成本,並用白話說明該經濟系統
  • 將通過檢查的規格儲存到專案中,並準備由擁有者在自己錢包中核准的上線步驟
  • 讀取已上線經濟系統的鏈上狀態,並說明應用程式如何以玩家錢包呼叫它
適用情境
適合在有人想建立或檢視 Solana 遊戲或社群經濟系統(盲盒、抽獎、拍賣、質押農場、合成等),並希望在上鏈前完成檢查與模擬時使用。也適合說明現有經濟系統,或把遊戲前端接上它。
執行需求
透過 npm 套件 @xgamesfun/solana 以 stdio 在本機執行,需要 Node.js 22 或更新版本。未宣告帳號、金鑰或 API key。選用環境變數:XSOLANA_RPC_URL(approve 與 status 使用的 devnet RPC),以及 XSOLANA_NO_OPEN、XSOLANA_DEBUG。上線需要擁有者在本地核准頁面連接 devnet 錢包。
安裝前請注意
僅限 devnet,且該程式未經獨立稽核。發布步驟會準備真實交易,須由擁有者在自己錢包中核准;助理不會簽章也不會索取金鑰,規格中不得包含金鑰。模擬與成本數字僅為估算而非保證,README 聲明不提供擔保,也不構成法律或財務建議。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 xsolana,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

solana-kit

The tools for loot, one shared Solana program for game and community economies. This repository is the npm package @xgamesfun/solana:

  • a JavaScript client with no Solana SDK (@xgamesfun/solana/client), a player module for apps (/play) and a results client (/results);
  • the economy spec and its checker, quick simulation, cost and plain-words explainer;
  • the xsolana CLI and an MCP server with ten xsolana_* tools;
  • the xsolana-economy skill, and one plugin that carries the tools and the skill to Claude Code and Codex;
  • a local approval page where a project's owner approves going live in their own wallet.

An economy is a JSON spec, not a new smart contract. Every project shares the one program, and none writes its own.

Status: loot 0.22.0, program ID 9cwqM1TXytPnFZsLfmUyv2dg4uW6Ch9C6UJVPns7NFQ, devnet only. The program is not independently audited, and nothing runs on mainnet until it is. See SECURITY.md.

Disclaimer: provided as is, with no warranty and no guarantee that the program or the tools are safe. Use them at your own risk; you are responsible for every transaction you approve and for making sure what you build is legal where it runs. Nothing here is legal or financial advice. Read DISCLAIMER.md before you use it.

What an economy can be made of

  • payments and splits, in tokens or with an NFT
  • shops (a purchase in one transaction) and loot boxes
  • pools and timed schedules, sealed or not
  • lotteries and raffles, including no-loss lotteries
  • prizes of any kind on every route, random or not: items, tokens, and NFTs the project holds in a stash
  • an NFT as the price on every route that takes money
  • staking farms with lock tiers, boosts, early exits and tolls
  • crafting recipes
  • holds and contests, with prizes by rank or by stake
  • auctions: the highest bid wins, the outbid refunded at once
  • listings for sale or rent, and bids and loans between players
  • perks, staking and holds for any NFT, whether the project has authority over it or not
  • allowlists of any size (a Merkle list) on every gated route
  • capped rewards and grants that a server vouches for
  • rules on what a collectible says

Every move leaves a public receipt. docs/program.md describes how the program behaves.

Use it from an AI coding agent

The MCP server and the skill let Claude Code, Codex or any MCP agent turn a one-line idea into a checked, simulated economy and hand you the command that puts it live in your own wallet.

Claude Code

/plugin marketplace add XGamesFun/solana-kit/plugin install xsolana@xgamesfun

Codex

codex plugin marketplace add XGamesFun/solana-kitcodex plugin add xsolana@xgamesfun

Any agent with MCP (Cursor, opencode, Cline…): run the server with npx -y --package=@xgamesfun/[email protected] xsolana mcp. Or let npx -y @xgamesfun/[email protected] connect register it, with the skill, for Claude Code and Codex.

Then ask for an economy, for example "a fishing game where each cast costs 0.02 SOL, with a rare golden fish and a monthly draw".

Going live is always yours: npx -y @xgamesfun/[email protected] approve opens a page on your computer where you connect a devnet wallet and approve each transaction. The agent never signs and never asks for a key.

Use it from a terminal

Every tool runs from the CLI too, on a spec file (xsolana.json by default):

bash
npx -y @xgamesfun/[email protected] examples shop with loot boxes   # the nearest worked examplesnpx -y @xgamesfun/[email protected] check xsolana.json                 # refusals and warningsnpx -y @xgamesfun/[email protected] simulate xsolana.json              # where the money goes, day by daynpx -y @xgamesfun/[email protected] cost xsolana.json                  # what going live and each action costnpx -y @xgamesfun/[email protected] explain xsolana.json               # the economy in plain wordsnpx -y @xgamesfun/[email protected] approve xsolana.json               # go live, approved in your own wallet

xsolana help lists every command. Every command names the exact version, so npx runs that release and never whatever is newest under the name.

Use it from code

bash
npm install @xgamesfun/solana
js
import * as loot from '@xgamesfun/solana/client';const ix = loot.openBoxIx({ player, project, box, nonce }); // one builder per instruction, no Solana SDK
ImportWhat
@xgamesfun/solanathe economy tools: check, simulate, plan, cost, explainEconomy, model
@xgamesfun/solana/clientevery PDA, one builder per instruction, account and receipt decoders, grant vouchers
@xgamesfun/solana/playsolanaApp: what a player does with a live economy, from a browser app
@xgamesfun/solana/resultsresults and vouchers a game's server signs
@xgamesfun/solana/chain/*browser-safe Solana primitives: base58, Borsh, transactions, PDAs, tokens, Core
@xgamesfun/solana/idl.jsonthe program's IDL, the authority for account and argument layouts
@xgamesfun/solana/release.jsonthe program build, IDL and client this release is pinned to

The client, chain and play modules run in browsers and Node 22 or later, with no bundler required. The package ships TypeScript declarations for every entry point.

Documentation

docs/program.mdthe program: who signs, accounts, every instruction, fees, limits, receipts, costs
docs/nfts.mdNFTs and tokens, with and without the project's authority
docs/harnesses.mdhow the plugin reaches Claude Code and Codex, and the release checklist
skills/xsolana-economythe skill an agent follows
examples/whole economies that check and go live in the tests; ideas.json, 112 real economies rated
evals/fresh-session evals of agents building on loot
CHANGELOG.md, SECURITY.mdversions, the trust model, reporting a vulnerability

Layout

PathWhat
js/chain/browser-safe Solana primitives, no SDK
js/client/the client; idl/ is the program's IDL
js/economy/the economy spec (version 2, schema.json), checker, simulation, setup plan, cost, explainer, guide
js/play/, js/results/a player's side of a live economy; results a server vouches for
js/approve/, js/mcp/, js/connect/the approval page, the MCP server and its tools, xsolana connect
js/sim/, js/test/LiteSVM running the real program; the tests and their pinned fixtures
bin/xsolana.mjsthe CLI
skills/, plugin/the skill (copied to plugin/skills, .claude/skills, .agents/skills) and the plugin
scripts/fixtures, skill sync, IDL sync, release manifest, a devnet end-to-end run
release.jsonthe program binary, IDL and client hashes this version is pinned to

Development

Node 22 or later.

bash
npm cinpm run fixtures   # downloads the loot program from devnet and the programs it calls from mainnet, each checked by hashnpm test           # every instruction the client builds, and every example's whole setup, against the real program in LiteSVMnpm run lint       # ESLintnpm run check      # fixtures, skill copies and release.json in step, lint, then the tests

Nothing in the tests deploys or spends SOL.

VariableWhat it does
XSOLANA_RPC_URLa devnet RPC of your own for xsolana approve and xsolana status (a mainnet URL is refused)
XSOLANA_NO_OPENxsolana approve prints its link without opening a browser
XSOLANA_DEBUGthe CLI prints a failure's whole stack, not one line
XSOLANA_PROGRAM_DIRthe tests run that program build's target/deploy/loot.so, and check the IDL against it
node bin/xsolana.mjs connect --local registers this checkout's MCP server and the skill with Claude Code and Codex
(--remove takes them out again).

After editing skills/, run npm run sync-skills. Changes to tool texts, the skill or the plugin are best measured with the evals before and after (evals/README.md). AGENTS.md has the rules for working in this repository, for people and coding agents alike.

Contributing

Issues and pull requests are welcome: see CONTRIBUTING.md. Please run npm run check before sending a change, and report a vulnerability privately as SECURITY.md describes.

License

Apache-2.0. See NOTICE and DISCLAIMER.md: provided as is, without warranty, at your own risk.

來源:README.md,提交 30826a2

工具

10

xsolana_guide

Read this first whenever someone wants a web3 economy, game economy, token economy, NFT mechanic or onchain reward system: a shop, loot boxes or packs, gacha, a lottery or raffle, an auction (highest bid wins, the outbid refunded at once), staking or a farm, crafting or merging, seasons and emissions, a prediction pool or contest, quests and airdrops, holder-gated drops, using NFTs of any other collection in a game. loot is ONE shared Solana program (devnet until it is audited): the economy is a JSON spec, not a new smart contract, so never write Anchor/Rust for what it covers. Returns every part an economy can have (fields from the schema, who acts at play time, fees), how to write a spec, and what loot cannot do (with the nearest alternative). Pass `part` for one part with its nested shapes.

輸入參數part

xsolana_examples

Find an economy to start from. With `query` (the person’s own words, as they said them), returns the closest worked examples (whole specs that check and go live in the tests), the closest of 112 real or trending economies rated against loot (great / some / a-lot / cannot, with what carries it or what is missing), and what loot can’t do exactly in the ask, each with the nearest versions it can. Call it again with the words of any part that looks impossible: the answer is a nearest version to offer, not a dead end. With `name`, returns that example’s whole spec to copy and change. With neither, lists every example.

輸入參數fitnamelimitquery

xsolana_check

Check an economy spec: refusals (each with a code, what it means and its fix) stop it from going live; warnings are what the person must hear (chance that pays money, revenue paid to stakers, an unfunded prize, a grant without limits, a mint’s powers). Run it after every change. Give the spec inline (`spec`), a file, or an example.

輸入參數filespecexample

xsolana_simulate

The quick simulation (expected values from the spec, instant): what each box, ticket and craft gives back against its price, the house edge, each pool’s money in and out per day and whether it runs dry, settles or grows, farm rewards per unit staked, what players, the treasury and the platform get each day. `scenario` overrides the spec’s own ({"perDay": {"box:flip": 1000}, "days": 30, "staked": {"<farm>": 1000}}). Quote its numbers; never your own arithmetic.

輸入參數filejsonspecexamplescenario

xsolana_cost

What going live costs (each account’s rent, the program’s fees, network fees, the seeds, the transactions and wallet approvals it takes) and what each action costs whoever signs it while it runs.

輸入參數filespecexample

xsolana_explain

The economy in plain words for the person: what players do and what it costs and is worth, how the pools fill and drain, what runs by itself, what the authority must sign, what going live costs, and what is flagged for the law. Tell them the essentials in a few lines, from this text.

輸入參數filespecexample

xsolana_save

Save a spec into the project (default xsolana.json), only if it checks. A file that is already live keeps its program numbers and its live section. Never put a key in it: the checker refuses one.

輸入參數filespec必填

xsolana_publish

When the person says to put it live: returns what going live does (every step, in order, and its cost) and the one command they run themselves to approve it in their own wallet (`npx -y @xgamesfun/[email protected] approve`, pinned to this exact version: give it as it is): it opens a local page where they connect a devnet wallet and approve each transaction. You never sign, never ask for a key, and never run the approval for them.

輸入參數filespecexample

xsolana_status

A live economy as it is on chain: the project, every pool’s balance, every record the spec names (found or missing). Reads devnet (or XSOLANA_RPC_URL).

輸入參數file

xsolana_client

How an app (a game, a site, a bot) uses a live economy: the program’s address and cluster, the npm package and IDL, and the calls a page makes with the player’s own wallet (open a box, buy, stake, craft, enter, claim). Use this instead of writing chain code from memory.

無需輸入參數。

版本歷史

1
  1. v0.20.1最新Oct 30, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分