pyre-world-kit 2.0.12 → 3.0.1

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.
Files changed (53) hide show
  1. package/.prettierrc.json +6 -0
  2. package/dist/index.d.ts +46 -4
  3. package/dist/index.js +105 -85
  4. package/dist/providers/action.provider.d.ts +46 -0
  5. package/dist/providers/action.provider.js +331 -0
  6. package/dist/providers/intel.provider.d.ts +29 -0
  7. package/dist/providers/intel.provider.js +363 -0
  8. package/dist/providers/mapper.provider.d.ts +197 -0
  9. package/dist/providers/mapper.provider.js +158 -0
  10. package/dist/providers/registry.provider.d.ts +25 -0
  11. package/dist/providers/registry.provider.js +229 -0
  12. package/dist/providers/state.provider.d.ts +42 -0
  13. package/dist/providers/state.provider.js +348 -0
  14. package/dist/pyre_world.json +34 -229
  15. package/dist/types/action.types.d.ts +41 -0
  16. package/dist/types/action.types.js +2 -0
  17. package/dist/types/intel.types.d.ts +20 -0
  18. package/dist/types/intel.types.js +2 -0
  19. package/dist/types/mapper.types.d.ts +27 -0
  20. package/dist/types/mapper.types.js +22 -0
  21. package/dist/types/registry.types.d.ts +0 -0
  22. package/dist/types/registry.types.js +1 -0
  23. package/dist/types/state.types.d.ts +112 -0
  24. package/dist/types/state.types.js +2 -0
  25. package/dist/types.d.ts +8 -24
  26. package/dist/util.d.ts +29 -0
  27. package/dist/util.js +144 -0
  28. package/dist/vanity.d.ts +3 -3
  29. package/dist/vanity.js +18 -15
  30. package/package.json +4 -2
  31. package/readme.md +184 -142
  32. package/src/index.ts +133 -92
  33. package/src/providers/action.provider.ts +443 -0
  34. package/src/providers/intel.provider.ts +383 -0
  35. package/src/providers/mapper.provider.ts +195 -0
  36. package/src/providers/registry.provider.ts +277 -0
  37. package/src/providers/state.provider.ts +357 -0
  38. package/src/pyre_world.json +35 -230
  39. package/src/types/action.types.ts +76 -0
  40. package/src/types/intel.types.ts +22 -0
  41. package/src/types/mapper.types.ts +84 -0
  42. package/src/types/registry.types.ts +0 -0
  43. package/src/types/state.types.ts +144 -0
  44. package/src/types.ts +329 -333
  45. package/src/util.ts +148 -0
  46. package/src/vanity.ts +27 -14
  47. package/tests/test_e2e.ts +339 -172
  48. package/src/actions.ts +0 -719
  49. package/src/intel.ts +0 -521
  50. package/src/mappers.ts +0 -302
  51. package/src/registry.ts +0 -317
  52. package/tests/test_devnet_e2e.ts +0 -401
  53. package/tests/test_sim.ts +0 -458
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/types.d.ts CHANGED
@@ -9,10 +9,8 @@ import type { Transaction, Keypair, PublicKey } from '@solana/web3.js';
9
9
  import type { TokenSortOption, TransactionResult, CreateTokenResult, SaidVerification, ConfirmResult, EphemeralAgent } from 'torchsdk';
10
10
  /** Faction lifecycle: rising (bonding) → ready (complete) → ascended (migrated) → razed (reclaimed) */
11
11
  export type FactionStatus = 'rising' | 'ready' | 'ascended' | 'razed';
12
- /** Faction tier based on SOL target: ember (spark) → blaze (flame) → inferno (torch) */
13
- export type FactionTier = 'ember' | 'blaze' | 'inferno';
14
12
  /** Governance strategy: scorched_earth (burn tokens) or fortify (return to treasury lock) */
15
- export type Strategy = 'scorched_earth' | 'fortify';
13
+ export type Strategy = 'smelt' | 'fortify';
16
14
  /** Agent loan health status */
17
15
  export type AgentHealth = 'healthy' | 'at_risk' | 'liquidatable' | 'none';
18
16
  /** Summary view of a faction (wraps TokenSummary) */
@@ -21,7 +19,6 @@ export interface FactionSummary {
21
19
  name: string;
22
20
  symbol: string;
23
21
  status: FactionStatus;
24
- tier: FactionTier;
25
22
  price_sol: number;
26
23
  market_cap_sol: number;
27
24
  progress_percent: number;
@@ -37,7 +34,6 @@ export interface FactionDetail {
37
34
  description?: string;
38
35
  image?: string;
39
36
  status: FactionStatus;
40
- tier: FactionTier;
41
37
  price_sol: number;
42
38
  price_usd?: number;
43
39
  market_cap_sol: number;
@@ -165,26 +161,20 @@ export interface JoinFactionParams {
165
161
  mint: string;
166
162
  agent: string;
167
163
  amount_sol: number;
168
- slippage_bps?: number;
169
- strategy?: Strategy;
170
- message?: string;
171
164
  stronghold: string;
172
- }
173
- export interface DirectJoinFactionParams {
174
- mint: string;
175
- agent: string;
176
- amount_sol: number;
177
165
  slippage_bps?: number;
178
166
  strategy?: Strategy;
179
167
  message?: string;
168
+ ascended?: boolean;
180
169
  }
181
170
  export interface DefectParams {
182
171
  mint: string;
183
172
  agent: string;
184
173
  amount_tokens: number;
174
+ stronghold: string;
185
175
  slippage_bps?: number;
186
176
  message?: string;
187
- stronghold?: string;
177
+ ascended?: boolean;
188
178
  }
189
179
  /** "Said in" — micro buy + message (costs 0.001 SOL) */
190
180
  export interface MessageFactionParams {
@@ -213,19 +203,19 @@ export interface RequestWarLoanParams {
213
203
  borrower: string;
214
204
  collateral_amount: number;
215
205
  sol_to_borrow: number;
216
- stronghold?: string;
206
+ stronghold: string;
217
207
  }
218
208
  export interface RepayWarLoanParams {
219
209
  mint: string;
220
210
  borrower: string;
221
211
  sol_amount: number;
222
- stronghold?: string;
212
+ stronghold: string;
223
213
  }
224
214
  export interface SiegeParams {
225
215
  mint: string;
226
216
  liquidator: string;
227
217
  borrower: string;
228
- stronghold?: string;
218
+ stronghold: string;
229
219
  }
230
220
  export interface TradeOnDexParams {
231
221
  mint: string;
@@ -285,11 +275,6 @@ export interface RazeParams {
285
275
  mint: string;
286
276
  }
287
277
  export interface TitheParams {
288
- mint: string;
289
- payer: string;
290
- sources?: string[];
291
- }
292
- export interface ConvertTitheParams {
293
278
  mint: string;
294
279
  payer: string;
295
280
  minimum_amount_out?: number;
@@ -297,7 +282,7 @@ export interface ConvertTitheParams {
297
282
  sources?: string[];
298
283
  }
299
284
  /** Re-export base result types with game names */
300
- export type { TransactionResult, CreateTokenResult, EphemeralAgent, SaidVerification, ConfirmResult };
285
+ export type { TransactionResult, CreateTokenResult, EphemeralAgent, SaidVerification, ConfirmResult, };
301
286
  export interface JoinFactionResult extends TransactionResult {
302
287
  migrationTransaction?: Transaction;
303
288
  }
@@ -359,7 +344,6 @@ export interface AgentProfile {
359
344
  stronghold: Stronghold | null;
360
345
  factions_joined: AgentFactionPosition[];
361
346
  factions_founded: string[];
362
- said_verification: SaidVerification | null;
363
347
  total_value_sol: number;
364
348
  }
365
349
  export interface AgentFactionPosition {
package/dist/util.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Pyre Kit Actions
3
+ *
4
+ * Thin wrappers that call torchsdk functions and map params/results
5
+ * into game-semantic Pyre types. No new on-chain logic.
6
+ */
7
+ import { PublicKey } from '@solana/web3.js';
8
+ import { Intel } from './types/intel.types';
9
+ /** Add mints to the blacklist (call at startup with old mints) */
10
+ export declare function blacklistMints(mints: string[]): void;
11
+ /** Check if a mint is blacklisted */
12
+ export declare function isBlacklistedMint(mint: string): boolean;
13
+ /** Get all blacklisted mints */
14
+ export declare function getBlacklistedMints(): string[];
15
+ /** Create an ephemeral agent keypair (memory-only, zero key management) */
16
+ export { createEphemeralAgent } from 'torchsdk';
17
+ /** Get the Raydium pool state PDA for an ascended faction's DEX pool */
18
+ export declare function getDexPool(mint: string): PublicKey;
19
+ /** Get Raydium pool vault addresses for an ascended faction */
20
+ export declare function getDexVaults(mint: string): {
21
+ solVault: string;
22
+ tokenVault: string;
23
+ };
24
+ export declare const startVaultPnlTracker: (intel: Intel, wallet: string) => Promise<{
25
+ finish: () => Promise<{
26
+ spent: number;
27
+ received: number;
28
+ }>;
29
+ }>;
package/dist/util.js ADDED
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ /**
3
+ * Pyre Kit Actions
4
+ *
5
+ * Thin wrappers that call torchsdk functions and map params/results
6
+ * into game-semantic Pyre types. No new on-chain logic.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.startVaultPnlTracker = exports.createEphemeralAgent = void 0;
10
+ exports.blacklistMints = blacklistMints;
11
+ exports.isBlacklistedMint = isBlacklistedMint;
12
+ exports.getBlacklistedMints = getBlacklistedMints;
13
+ exports.getDexPool = getDexPool;
14
+ exports.getDexVaults = getDexVaults;
15
+ const web3_js_1 = require("@solana/web3.js");
16
+ const torchsdk_1 = require("torchsdk");
17
+ // ─── Blacklist ──────────────────────────────────────────────────────
18
+ // Mints from previous swarm runs. Agents should skip these and only
19
+ // interact with freshly launched factions.
20
+ const DEFAULT_BLACKLIST = [
21
+ 'E1SgYPW6JXhw5BabrvJkr6L2PyvfFenYaoCTePazyNpy',
22
+ '6jWsyDC87RmfrZZRjuxSAxvUxE665HGZwZ2Z8j5z9epy',
23
+ '6J8PLgFxHb98cNURP2Yt2SKwgnUeEXpN6Us2kxaMz1py',
24
+ '5A297UyPQstxWpJyydDnFvn2zN8whCEYdqvnfB5bF9py',
25
+ '8XdWfSKLJusAcRrYzK3bWJ7dy46AkbU8qxF3B55uSfpy',
26
+ '7ZYrKcJbFFbG36keCYRvfc1j1HScQmJW1zRV3wVVD4py',
27
+ 'ERQPyG2oqx5bdyuY2Nnm5ZbZY2zcB46TfUxqpzYWH5py',
28
+ 'JCvpK3kTnh2EdQG71mqE8ZXcvzLU5EJNG5vgGZme4wpy',
29
+ '9RDFkGSjKpjHtXZ25uuug2MN5P7oSjzkLg16HcrKy3py',
30
+ '2kWcX1ZetV4jUtBPbKKk265q4gS4nuut2kc1MbaZDfpy',
31
+ '3r9FnQim6GToR7NkY5om8igUNu7gfpq5fk2qtv3bV5py',
32
+ '2498F79s1Ghyj3J4VhV1qy5hhznnM53ZwzTXM9iscopy',
33
+ '5VpotyDyc8QKKqLuzu8pfhtEa9gsRG1ww58DbqJUgTpy',
34
+ 'GXi1opahTkavPfAqfUhkoUJRBjPoAmAMVW87kdbDwNpy',
35
+ 'GKFAokGiyhXGXxUPgwQEo8fE5nBjRdJcVX6LVj7SgPpy',
36
+ 'EKFVwfNk1xzqhpyFJSMNw8KDcLRemvqxiGoSyfRtBspy',
37
+ 'GsZLHVt3mTwus5krUcifBWS52xMQSuXSy3RpPhEFtvpy',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KZq7A7yPckhFdN1amv1Q2tapy',
81
+ '2zTGWtQeJ5GtdHu888QikPzKkyHJPWVFYtoQjNeJJ7py',
82
+ 'HNnpL7z1GKsXuxaEHs2a52zW7tTUjU4dZnrSEf8ZsMpy',
83
+ 'EASit9Yrj1SBg6xchFxDSwVV9Rz11RKdDpB4tcNsekpy',
84
+ 'F7VcdtqsXV6nkDL3yk6esUBu9qGvka4EY9XNTQ7PmZpy',
85
+ '3huHC9Co5dy5Z5U6H8Vf7aVTcuukpKeUr8rDQx8s5Zpy',
86
+ '97ymhwybP8Jh45VcYBJY1pwQ5xkPLX15u7Tg3P7TG7py',
87
+ '92fMEzcYdcoEXX8A5T8i8vfz2S96P39abzoXXuBghfpy',
88
+ '2ZeQsU13WjgX2152qV3wyzxURjLg7GwfXznAiA99Jjpy',
89
+ 'FuUHck8jqaXxGiTuLym4gYXJQrueyEsgd8AMUQx2fMpy',
90
+ 'trTuaGATQZwUeYkYTeyJfQnGGnKRvAriAZRgBWg7Epy',
91
+ 'HEhemzeszztaFzFYR9DjpNwdhghVDD1y7cHxP93EPZpy',
92
+ 'obuf6MkL1ev6WuUDDjH3bq2q6Ryr6MBNMRsA6dEW4py',
93
+ '76ruUbqBpqSKsysoPesDrpaLsDSahWWphQmXrswiLbpy',
94
+ '4ci4scCevt5tXCxkGr5xHoWyaeQY1dahp5nFsTnfYApy',
95
+ 'shzuPKgqedBxJmxdrRyWAtajG3hSNyLr72SufvmEvpy',
96
+ // wave 4 (devnet cleanup)
97
+ 'ZkprRY78cmfSmjMvDmgb4rWRxnxNrQYpF8chejRt3py',
98
+ '4BFfCqG4L6bsS2tEZTpgQPJjsSqqLPQaxuaWMJcaRjpy',
99
+ '5xRA2q9oHjoxN1XgqMTZW3aRBgGppcLCCbLBURepXApy',
100
+ ];
101
+ const BLACKLISTED_MINTS = new Set(DEFAULT_BLACKLIST);
102
+ /** Add mints to the blacklist (call at startup with old mints) */
103
+ function blacklistMints(mints) {
104
+ for (const m of mints)
105
+ BLACKLISTED_MINTS.add(m);
106
+ }
107
+ /** Check if a mint is blacklisted */
108
+ function isBlacklistedMint(mint) {
109
+ return BLACKLISTED_MINTS.has(mint);
110
+ }
111
+ /** Get all blacklisted mints */
112
+ function getBlacklistedMints() {
113
+ return Array.from(BLACKLISTED_MINTS);
114
+ }
115
+ /** Create an ephemeral agent keypair (memory-only, zero key management) */
116
+ var torchsdk_2 = require("torchsdk");
117
+ Object.defineProperty(exports, "createEphemeralAgent", { enumerable: true, get: function () { return torchsdk_2.createEphemeralAgent; } });
118
+ /** Get the Raydium pool state PDA for an ascended faction's DEX pool */
119
+ function getDexPool(mint) {
120
+ const { poolState } = (0, torchsdk_1.getRaydiumMigrationAccounts)(new web3_js_1.PublicKey(mint));
121
+ return poolState;
122
+ }
123
+ /** Get Raydium pool vault addresses for an ascended faction */
124
+ function getDexVaults(mint) {
125
+ const accts = (0, torchsdk_1.getRaydiumMigrationAccounts)(new web3_js_1.PublicKey(mint));
126
+ return {
127
+ solVault: (accts.isWsolToken0 ? accts.token0Vault : accts.token1Vault).toString(),
128
+ tokenVault: (accts.isWsolToken0 ? accts.token1Vault : accts.token0Vault).toString(),
129
+ };
130
+ }
131
+ const startVaultPnlTracker = async (intel, wallet) => {
132
+ const before = await intel.getAgentSolLamports(wallet);
133
+ return {
134
+ async finish() {
135
+ const after = await intel.getAgentSolLamports(wallet);
136
+ const diff = after - before;
137
+ return {
138
+ spent: diff < 0 ? Math.abs(diff) : 0,
139
+ received: diff > 0 ? diff : 0,
140
+ };
141
+ },
142
+ };
143
+ };
144
+ exports.startVaultPnlTracker = startVaultPnlTracker;
package/dist/vanity.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare const getBondingCurvePda: (mint: PublicKey) => [PublicKey, number
11
11
  export declare const getTokenTreasuryPda: (mint: PublicKey) => [PublicKey, number];
12
12
  export declare const getTreasuryLockPda: (mint: PublicKey) => [PublicKey, number];
13
13
  /** Grind for a keypair whose base58 address ends with "py" */
14
- export declare function grindPyreMint(maxAttempts?: number): Keypair;
14
+ export declare const grindPyreMint: (maxAttempts?: number) => Keypair;
15
15
  /** Check if a mint address is a pyre faction (ends with "py") */
16
- export declare function isPyreMint(mint: string): boolean;
17
- export declare function buildCreateFactionTransaction(connection: Connection, params: CreateTokenParams): Promise<CreateTokenResult>;
16
+ export declare const isPyreMint: (mint: string) => boolean;
17
+ export declare const buildCreateFactionTransaction: (connection: Connection, params: CreateTokenParams) => Promise<CreateTokenResult>;
package/dist/vanity.js CHANGED
@@ -10,10 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.getTreasuryLockPda = exports.getTokenTreasuryPda = exports.getBondingCurvePda = void 0;
14
- exports.grindPyreMint = grindPyreMint;
15
- exports.isPyreMint = isPyreMint;
16
- exports.buildCreateFactionTransaction = buildCreateFactionTransaction;
13
+ exports.buildCreateFactionTransaction = exports.isPyreMint = exports.grindPyreMint = exports.getTreasuryLockPda = exports.getTokenTreasuryPda = exports.getBondingCurvePda = void 0;
17
14
  const web3_js_1 = require("@solana/web3.js");
18
15
  const spl_token_1 = require("@solana/spl-token");
19
16
  const anchor_1 = require("@coral-xyz/anchor");
@@ -53,7 +50,7 @@ const finalizeTransaction = async (connection, tx, feePayer) => {
53
50
  // ── Vanity grinder ──
54
51
  const PYRE_SUFFIX = 'py';
55
52
  /** Grind for a keypair whose base58 address ends with "py" */
56
- function grindPyreMint(maxAttempts = 500_000) {
53
+ const grindPyreMint = (maxAttempts = 500_000) => {
57
54
  for (let i = 0; i < maxAttempts; i++) {
58
55
  const kp = web3_js_1.Keypair.generate();
59
56
  if (kp.publicKey.toBase58().endsWith(PYRE_SUFFIX)) {
@@ -62,21 +59,21 @@ function grindPyreMint(maxAttempts = 500_000) {
62
59
  }
63
60
  // Fallback — return last generated keypair (should be extremely rare)
64
61
  return web3_js_1.Keypair.generate();
65
- }
62
+ };
63
+ exports.grindPyreMint = grindPyreMint;
66
64
  /** Check if a mint address is a pyre faction (ends with "py") */
67
- function isPyreMint(mint) {
68
- return mint.endsWith(PYRE_SUFFIX);
69
- }
65
+ const isPyreMint = (mint) => mint.endsWith(PYRE_SUFFIX);
66
+ exports.isPyreMint = isPyreMint;
70
67
  // ── Build create transaction with pyre vanity address ──
71
- async function buildCreateFactionTransaction(connection, params) {
72
- const { creator: creatorStr, name, symbol, metadata_uri, sol_target = 0, community_token = true } = params;
68
+ const buildCreateFactionTransaction = async (connection, params) => {
69
+ const { creator: creatorStr, name, symbol, metadata_uri, sol_target = 0, community_token = true, } = params;
73
70
  const creator = new web3_js_1.PublicKey(creatorStr);
74
71
  if (name.length > 32)
75
72
  throw new Error('Name must be 32 characters or less');
76
73
  if (symbol.length > 10)
77
74
  throw new Error('Symbol must be 10 characters or less');
78
75
  // Grind for "pyre" suffix instead of "tm"
79
- const mint = grindPyreMint();
76
+ const mint = (0, exports.grindPyreMint)();
80
77
  // Derive PDAs
81
78
  const [globalConfig] = getGlobalConfigPda();
82
79
  const [bondingCurve] = (0, exports.getBondingCurvePda)(mint.publicKey);
@@ -88,8 +85,13 @@ async function buildCreateFactionTransaction(connection, params) {
88
85
  const tx = new web3_js_1.Transaction();
89
86
  const provider = makeDummyProvider(connection, creator);
90
87
  const program = new anchor_1.Program(torch_market_json_1.default, provider);
91
- const createIx = await program.methods
92
- .createToken({ name, symbol, uri: metadata_uri, solTarget: new anchor_1.BN(sol_target), communityToken: community_token })
88
+ const createIx = await program.methods.createToken({
89
+ name,
90
+ symbol,
91
+ uri: metadata_uri,
92
+ solTarget: new anchor_1.BN(sol_target),
93
+ communityToken: community_token,
94
+ })
93
95
  .accounts({
94
96
  creator,
95
97
  globalConfig,
@@ -116,4 +118,5 @@ async function buildCreateFactionTransaction(connection, params) {
116
118
  mintKeypair: mint,
117
119
  message: `Create faction "${name}" ($${symbol}) [pyre:${mint.publicKey.toBase58()}]`,
118
120
  };
119
- }
121
+ };
122
+ exports.buildCreateFactionTransaction = buildCreateFactionTransaction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyre-world-kit",
3
- "version": "2.0.12",
3
+ "version": "3.0.1",
4
4
  "description": "Agent-first faction warfare kit — game-semantic wrapper over torchsdk",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,8 @@
8
8
  "build": "tsc",
9
9
  "test": "npx tsx tests/test_e2e.ts",
10
10
  "test:sim": "npx tsx tests/test_sim.ts",
11
- "test:devnet": "npx tsx tests/test_devnet_e2e.ts"
11
+ "test:devnet": "npx tsx tests/test_devnet_e2e.ts",
12
+ "format": "prettier --write src/"
12
13
  },
13
14
  "dependencies": {
14
15
  "@coral-xyz/anchor": "^0.32.1",
@@ -19,6 +20,7 @@
19
20
  },
20
21
  "devDependencies": {
21
22
  "@types/node": "^22.15.0",
23
+ "prettier": "^3.5.3",
22
24
  "tsx": "^4.19.4",
23
25
  "typescript": "^5.9.3"
24
26
  },