@xgamesfun/solana 0.28.5 → 0.28.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -77,7 +77,7 @@ codex plugin add xsolana@xgamesfun
77
77
 
78
78
  **claude.ai, ChatGPT or Claude Desktop:** add `https://xgames.fun/mcp` as a custom connector. Nothing to install.
79
79
 
80
- **Cursor, Cline, opencode or any MCP client:** run `npx -y --package=@xgamesfun/solana@0.28.5 xsolana mcp`.
80
+ **Cursor, Cline, opencode or any MCP client:** run `npx -y --package=@xgamesfun/solana@0.28.6 xsolana mcp`.
81
81
 
82
82
  **Any agent that reads skills** (Copilot, Gemini CLI, Windsurf…): `npx skills add XGamesFun/solana-kit`.
83
83
 
@@ -88,26 +88,26 @@ are in [docs/harnesses.md](docs/harnesses.md).
88
88
 
89
89
  ```bash
90
90
  # find a worked example close to your idea
91
- npx -y @xgamesfun/solana@0.28.5 examples shop with loot boxes
91
+ npx -y @xgamesfun/solana@0.28.6 examples shop with loot boxes
92
92
 
93
93
  # using a coin you already launched? read it from the chain into its "tokens" entry
94
- npx -y @xgamesfun/solana@0.28.5 token <its mint address>
94
+ npx -y @xgamesfun/solana@0.28.6 token <its mint address>
95
95
 
96
96
  # does it work? where does the money go? what does it cost?
97
- npx -y @xgamesfun/solana@0.28.5 check xsolana.json
98
- npx -y @xgamesfun/solana@0.28.5 simulate xsolana.json
99
- npx -y @xgamesfun/solana@0.28.5 cost xsolana.json
97
+ npx -y @xgamesfun/solana@0.28.6 check xsolana.json
98
+ npx -y @xgamesfun/solana@0.28.6 simulate xsolana.json
99
+ npx -y @xgamesfun/solana@0.28.6 cost xsolana.json
100
100
 
101
101
  # the whole economy in plain words, and what a cheater could get
102
- npx -y @xgamesfun/solana@0.28.5 explain xsolana.json
103
- npx -y @xgamesfun/solana@0.28.5 review xsolana.json
102
+ npx -y @xgamesfun/solana@0.28.6 explain xsolana.json
103
+ npx -y @xgamesfun/solana@0.28.6 review xsolana.json
104
104
 
105
105
  # go live: a key file for the project (it prints the address to send SOL to, never the key)…
106
- npx -y @xgamesfun/solana@0.28.5 keygen ~/.config/xsolana/my-game.json
106
+ npx -y @xgamesfun/solana@0.28.6 keygen ~/.config/xsolana/my-game.json
107
107
  # …then everything going live would send, and a code; nothing is sent
108
- npx -y @xgamesfun/solana@0.28.5 approve xsolana.json --keypair ~/.config/xsolana/my-game.json
108
+ npx -y @xgamesfun/solana@0.28.6 approve xsolana.json --keypair ~/.config/xsolana/my-game.json
109
109
  # …and with that code, exactly what it listed is sent
110
- npx -y @xgamesfun/solana@0.28.5 approve xsolana.json --keypair ~/.config/xsolana/my-game.json --yes <code>
110
+ npx -y @xgamesfun/solana@0.28.6 approve xsolana.json --keypair ~/.config/xsolana/my-game.json --yes <code>
111
111
  ```
112
112
 
113
113
  Each command names an exact version, so you always run the release you meant to. `xsolana help` lists them all.
@@ -83,7 +83,9 @@ export function approvalCode(state, spec) {
83
83
  for (const f of state.fresh ?? []) shown = shown.replaceAll(f.address, `<new ${f.name}>`);
84
84
  shown = shown.replace(WRITTEN_TIME, '<a time>');
85
85
  // The file as it is, live section and all: what the steps are built from, whether or not a line names it.
86
- return createHash('sha256').update(JSON.stringify(spec)).update('\n').update(shown).digest('hex').slice(0, 8);
86
+ const hex = createHash('sha256').update(JSON.stringify(spec)).update('\n').update(shown).digest('hex').slice(0, 8);
87
+ // (on mainnet the code says so: whoever types it back types "mainnet", a step beyond the file's own word)
88
+ return state.cluster === 'mainnet' ? `mainnet-${hex}` : hex;
87
89
  }
88
90
 
89
91
  /** A new account of the setup in words: "mint/gold" is the mint of the token “gold”. */
@@ -99,6 +101,11 @@ const freshName = name =>
99
101
  /** What the page shows before Approve, as lines of text. `balance`: the key's lamports, or null when not read. */
100
102
  export function approvalText(state, { keyFile, balance = null }) {
101
103
  const lines = [];
104
+ // (on mainnet, the first thing said: what is sent is real money)
105
+ if (state.cluster === 'mainnet')
106
+ lines.push(
107
+ 'MAINNET: everything below moves real SOL and real tokens, and cannot be undone. loot is not independently audited.',
108
+ );
102
109
  const kind =
103
110
  state.mode === 'change'
104
111
  ? 'a change to a live economy'
@@ -221,7 +228,7 @@ export async function approveWithKey({
221
228
  }
222
229
  if (yes === null && confirm) {
223
230
  const said = await confirm(
224
- `Send ${count(state.remaining, 'transaction')} from ${key.address}? Type yes to send: `,
231
+ `${state.cluster === 'mainnet' ? 'This is MAINNET: real SOL and real tokens. ' : ''}Send ${count(state.remaining, 'transaction')} from ${key.address}? Type yes to send: `,
225
232
  );
226
233
  if (!said) {
227
234
  out('Nothing was sent.');
@@ -201,7 +201,7 @@ export function explainEconomy(economy, { now = Math.floor(Date.now() / 1000) }
201
201
  .filter(k => economy[k]?.length)
202
202
  .map(k => plural(economy[k].length, ONE[k], k));
203
203
  lines.push(
204
- `${economy.name ?? 'This economy'}: ${counted.join(', ') || 'nothing yet'}. The project’s currency is ${m.currency?.symbol ?? '(none)'}${m.currency ? ` (${m.currency.source === 'sol' ? 'SOL' : m.currency.source === 'game' ? 'a token the project mints' : `an existing ${m.currency.program === 'token-2022' ? 'Token-2022 ' : ''}mint`})` : ''}. It runs on the shared loot program, devnet only: no contract of its own.`,
204
+ `${economy.name ?? 'This economy'}: ${counted.join(', ') || 'nothing yet'}. The project’s currency is ${m.currency?.symbol ?? '(none)'}${m.currency ? ` (${m.currency.source === 'sol' ? 'SOL' : m.currency.source === 'game' ? 'a token the project mints' : `an existing ${m.currency.program === 'token-2022' ? 'Token-2022 ' : ''}mint`})` : ''}. It runs on the shared loot program, on ${realMoney() ? 'mainnet (real money)' : 'devnet'}: no contract of its own.`,
205
205
  );
206
206
  if (economy.prompt) lines.push(`Asked for: “${economy.prompt}”`);
207
207
 
package/js/mcp/tools.mjs CHANGED
@@ -297,7 +297,7 @@ export const tools = [
297
297
  name: 'xsolana_guide',
298
298
  annotations: READ,
299
299
  description:
300
- '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.',
300
+ '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 (on devnet, and on mainnet when the spec says "network": "mainnet"; not independently 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.',
301
301
  inputSchema: {
302
302
  type: 'object',
303
303
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xgamesfun/solana",
3
- "version": "0.28.5",
3
+ "version": "0.28.6",
4
4
  "mcpName": "io.github.XGamesFun/solana-kit",
5
5
  "description": "Loot boxes, gacha, shops, lotteries, auctions, NFT staking, crafting and rewards on Solana without writing a smart contract: one shared program, its JS client, a CLI, and an MCP server and skill so Claude Code, Codex or any AI agent can design, check, simulate and launch an economy.",
6
6
  "license": "Apache-2.0",
@@ -11,9 +11,9 @@ signed by a key file on the owner's own machine, once they have read what will b
11
11
  **devnet**, where nothing is real money, and on **mainnet**, where everything is: an economy is on devnet unless its
12
12
  file says `"network": "mainnet"`.
13
13
 
14
- The tools are the `xsolana_*` MCP tools. Without MCP, the same from a terminal: `npx -y @xgamesfun/solana@0.28.5 <guide|examples|check|simulate|cost|explain|review|publish|status> [xsolana.json]`,
15
- `npx -y @xgamesfun/solana@0.28.5 token <mint>` for a coin made elsewhere,
16
- or `npx -y @xgamesfun/solana@0.28.5 tool <name> '<json>'` for any tool (always with the exact version).
14
+ The tools are the `xsolana_*` MCP tools. Without MCP, the same from a terminal: `npx -y @xgamesfun/solana@0.28.6 <guide|examples|check|simulate|cost|explain|review|publish|status> [xsolana.json]`,
15
+ `npx -y @xgamesfun/solana@0.28.6 token <mint>` for a coin made elsewhere,
16
+ or `npx -y @xgamesfun/solana@0.28.6 tool <name> '<json>'` for any tool (always with the exact version).
17
17
 
18
18
  ## Rules (always)
19
19
 
@@ -141,7 +141,7 @@ or `npx -y @xgamesfun/solana@0.28.5 tool <name> '<json>'` for any tool (always w
141
141
  9. **When they say "put it live"**: `xsolana_publish` lists every step and its cost and gives the commands, which you
142
142
  run in the project folder exactly as given (they name the exact version; never drop it):
143
143
  - **A new economy gets a key file**, unless the project has one:
144
- `npx -y @xgamesfun/solana@0.28.5 keygen ~/.config/xsolana/<name>.json`. Give the person the address it prints. A
144
+ `npx -y @xgamesfun/solana@0.28.6 keygen ~/.config/xsolana/<name>.json`. Give the person the address it prints. A
145
145
  Solana key file they already have and name themselves (`~/.config/solana/id.json`) works the same; never go
146
146
  looking for one.
147
147
  - **Say what the key file is** before anything is sent: the project's owner, and, unless the spec says otherwise,
@@ -156,7 +156,7 @@ or `npx -y @xgamesfun/solana@0.28.5 tool <name> '<json>'` for any tool (always w
156
156
  devnet SOL for an economy on devnet, real SOL for one on mainnet), any seed in a coin that already exists, and every NFT a stash, a raffle or an auction names. A
157
157
  collection they already have needs the key's address as its update authority. If they would rather not move
158
158
  those, offer the browser wallet.
159
- - **Show it**: `npx -y @xgamesfun/solana@0.28.5 approve xsolana.json --keypair <key file>` prints every step with
159
+ - **Show it**: `npx -y @xgamesfun/solana@0.28.6 approve xsolana.json --keypair <key file>` prints every step with
160
160
  what it pays and trusts, the warnings, the notice and a code, and sends nothing. Give the person that printout as
161
161
  it is, not a summary of it, and ask.
162
162
  - **On their yes**, the same command with `--yes <code>`. What lands is written back into `xsolana.json`. If it