pyre-world-kit 3.1.2 → 3.2.0

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.
@@ -37,6 +37,9 @@ exports.StateProvider = void 0;
37
37
  const web3_js_1 = require("@solana/web3.js");
38
38
  const vanity_1 = require("../vanity");
39
39
  const util_1 = require("../util");
40
+ // Pre-warm imports — resolved once, cached as module-level promises
41
+ const splTokenImport = Promise.resolve().then(() => __importStar(require('@solana/spl-token')));
42
+ const torchsdkImport = Promise.resolve().then(() => __importStar(require('torchsdk')));
40
43
  const EMPTY_COUNTS = {
41
44
  join: 0,
42
45
  defect: 0,
@@ -60,6 +63,10 @@ class StateProvider {
60
63
  _state = null;
61
64
  checkpointConfig = null;
62
65
  ticksSinceCheckpoint = 0;
66
+ // Lazy vault — undefined = not resolved, null = resolved to nothing
67
+ _vaultCreator = undefined;
68
+ _stronghold = undefined;
69
+ _vaultPromise = null;
63
70
  constructor(connection, registry, publicKey) {
64
71
  this.connection = connection;
65
72
  this.registry = registry;
@@ -68,90 +75,108 @@ class StateProvider {
68
75
  get state() {
69
76
  return this._state;
70
77
  }
71
- get vaultCreator() {
72
- return this._state?.vaultCreator ?? null;
73
- }
74
78
  get initialized() {
75
79
  return this._state?.initialized ?? false;
76
80
  }
77
81
  get tick() {
78
82
  return this._state?.tick ?? 0;
79
83
  }
80
- /** Configure auto-checkpoint behavior */
81
84
  setCheckpointConfig(config) {
82
85
  this.checkpointConfig = config;
83
86
  }
84
- async init() {
85
- if (this._state?.initialized)
86
- return this._state;
87
- const state = {
88
- publicKey: this.publicKey,
89
- vaultCreator: null,
90
- stronghold: null,
91
- tick: 0,
92
- actionCounts: { ...EMPTY_COUNTS },
93
- holdings: new Map(),
94
- activeLoans: new Set(),
95
- founded: [],
96
- rallied: new Set(),
97
- voted: new Set(),
98
- sentiment: new Map(),
99
- recentHistory: [],
100
- personalitySummary: null,
101
- totalSolSpent: 0,
102
- totalSolReceived: 0,
103
- initialized: false,
104
- };
105
- this._state = state;
106
- // resolve vault link
107
- const { getVaultForWallet } = await Promise.resolve().then(() => __importStar(require('torchsdk')));
108
- try {
109
- const vault = await getVaultForWallet(this.connection, this.publicKey);
110
- if (vault) {
111
- state.vaultCreator = vault.creator;
112
- state.stronghold = {
113
- address: vault.address,
114
- creator: vault.creator,
115
- authority: vault.authority,
116
- sol_balance: vault.sol_balance,
117
- total_deposited: vault.total_deposited,
118
- total_withdrawn: vault.total_withdrawn,
119
- total_spent: vault.total_spent,
120
- total_received: vault.total_received,
121
- linked_agents: vault.linked_wallets,
122
- created_at: vault.created_at,
123
- };
124
- }
87
+ async resolveVault() {
88
+ if (this._vaultCreator !== undefined)
89
+ return;
90
+ if (!this._vaultPromise) {
91
+ this._vaultPromise = (async () => {
92
+ const { getVaultForWallet } = await torchsdkImport;
93
+ try {
94
+ const vault = await getVaultForWallet(this.connection, this.publicKey);
95
+ if (vault) {
96
+ this._vaultCreator = vault.creator;
97
+ this._stronghold = {
98
+ address: vault.address,
99
+ creator: vault.creator,
100
+ authority: vault.authority,
101
+ sol_balance: vault.sol_balance,
102
+ total_deposited: vault.total_deposited,
103
+ total_withdrawn: vault.total_withdrawn,
104
+ total_spent: vault.total_spent,
105
+ total_received: vault.total_received,
106
+ linked_agents: vault.linked_wallets,
107
+ created_at: vault.created_at,
108
+ };
109
+ }
110
+ else {
111
+ this._vaultCreator = null;
112
+ this._stronghold = null;
113
+ }
114
+ }
115
+ catch {
116
+ this._vaultCreator = null;
117
+ this._stronghold = null;
118
+ }
119
+ this._vaultPromise = null;
120
+ })();
125
121
  }
126
- catch { }
127
- try {
128
- const profile = await this.registry.getProfile(this.publicKey);
129
- if (profile) {
130
- state.personalitySummary = profile.personality_summary || null;
131
- state.totalSolSpent = profile.total_sol_spent;
132
- state.totalSolReceived = profile.total_sol_received;
133
- state.actionCounts.join = Math.max(state.actionCounts.join, profile.joins);
134
- state.actionCounts.defect = Math.max(state.actionCounts.defect, profile.defects);
135
- state.actionCounts.rally = Math.max(state.actionCounts.rally, profile.rallies);
136
- state.actionCounts.launch = Math.max(state.actionCounts.launch, profile.launches);
137
- state.actionCounts.message = Math.max(state.actionCounts.message, profile.messages);
138
- state.actionCounts.reinforce = Math.max(state.actionCounts.reinforce, profile.reinforces);
139
- state.actionCounts.fud = Math.max(state.actionCounts.fud, profile.fuds);
140
- state.actionCounts.infiltrate = Math.max(state.actionCounts.infiltrate, profile.infiltrates);
141
- state.actionCounts.war_loan = Math.max(state.actionCounts.war_loan, profile.war_loans);
142
- state.actionCounts.repay_loan = Math.max(state.actionCounts.repay_loan, profile.repay_loans);
143
- state.actionCounts.siege = Math.max(state.actionCounts.siege, profile.sieges);
144
- state.actionCounts.ascend = Math.max(state.actionCounts.ascend, profile.ascends);
145
- state.actionCounts.raze = Math.max(state.actionCounts.raze, profile.razes);
146
- state.actionCounts.tithe = Math.max(state.actionCounts.tithe, profile.tithes);
147
- const totalFromCheckpoint = Object.values(state.actionCounts).reduce((a, b) => a + b, 0);
148
- state.tick = totalFromCheckpoint;
122
+ return this._vaultPromise;
123
+ }
124
+ async getVaultCreator() {
125
+ await this.resolveVault();
126
+ return this._vaultCreator ?? null;
127
+ }
128
+ async getStronghold() {
129
+ await this.resolveVault();
130
+ return this._stronghold ?? null;
131
+ }
132
+ async init() {
133
+ if (!this._state?.initialized) {
134
+ const state = {
135
+ publicKey: this.publicKey,
136
+ tick: 0,
137
+ actionCounts: { ...EMPTY_COUNTS },
138
+ activeLoans: new Set(),
139
+ founded: [],
140
+ rallied: new Set(),
141
+ voted: new Set(),
142
+ sentiment: new Map(),
143
+ recentHistory: [],
144
+ personalitySummary: null,
145
+ totalSolSpent: 0,
146
+ totalSolReceived: 0,
147
+ initialized: false,
148
+ };
149
+ // Fire vault resolution in background — don't block init
150
+ this.resolveVault();
151
+ try {
152
+ const profile = await this.registry.getProfile(this.publicKey);
153
+ if (profile) {
154
+ state.personalitySummary = profile.personality_summary || null;
155
+ state.totalSolSpent = profile.total_sol_spent;
156
+ state.totalSolReceived = profile.total_sol_received;
157
+ state.actionCounts.join = Math.max(state.actionCounts.join, profile.joins);
158
+ state.actionCounts.defect = Math.max(state.actionCounts.defect, profile.defects);
159
+ state.actionCounts.rally = Math.max(state.actionCounts.rally, profile.rallies);
160
+ state.actionCounts.launch = Math.max(state.actionCounts.launch, profile.launches);
161
+ state.actionCounts.message = Math.max(state.actionCounts.message, profile.messages);
162
+ state.actionCounts.reinforce = Math.max(state.actionCounts.reinforce, profile.reinforces);
163
+ state.actionCounts.fud = Math.max(state.actionCounts.fud, profile.fuds);
164
+ state.actionCounts.infiltrate = Math.max(state.actionCounts.infiltrate, profile.infiltrates);
165
+ state.actionCounts.war_loan = Math.max(state.actionCounts.war_loan, profile.war_loans);
166
+ state.actionCounts.repay_loan = Math.max(state.actionCounts.repay_loan, profile.repay_loans);
167
+ state.actionCounts.siege = Math.max(state.actionCounts.siege, profile.sieges);
168
+ state.actionCounts.ascend = Math.max(state.actionCounts.ascend, profile.ascends);
169
+ state.actionCounts.raze = Math.max(state.actionCounts.raze, profile.razes);
170
+ state.actionCounts.tithe = Math.max(state.actionCounts.tithe, profile.tithes);
171
+ const totalFromCheckpoint = Object.values(state.actionCounts).reduce((a, b) => a + b, 0);
172
+ state.tick = totalFromCheckpoint;
173
+ }
149
174
  }
175
+ catch { }
176
+ state.initialized = true;
177
+ this._state = state;
150
178
  }
151
- catch { }
152
- await this.refreshHoldings();
153
- state.initialized = true;
154
- return state;
179
+ return this._state;
155
180
  }
156
181
  async record(action, mint, description) {
157
182
  if (!this._state)
@@ -171,7 +196,6 @@ class StateProvider {
171
196
  this._state.recentHistory = this._state.recentHistory.slice(-20);
172
197
  }
173
198
  }
174
- await this.refreshHoldings();
175
199
  if (this.checkpointConfig && this.ticksSinceCheckpoint >= this.checkpointConfig.interval) {
176
200
  this.ticksSinceCheckpoint = 0;
177
201
  this.onCheckpointDue?.();
@@ -182,15 +206,15 @@ class StateProvider {
182
206
  return;
183
207
  const current = this._state.sentiment.get(mint) ?? 0;
184
208
  const SENTIMENT_DELTAS = {
185
- join: 1,
186
- reinforce: 1.5,
187
- defect: -2,
188
- rally: 3,
189
- infiltrate: -5,
190
- message: 0.5,
191
- fud: -1.5,
192
- war_loan: 1,
193
- launch: 3,
209
+ join: 0.1,
210
+ reinforce: 0.15,
211
+ defect: -0.2,
212
+ rally: 0.3,
213
+ infiltrate: -0.5,
214
+ message: 0.05,
215
+ fud: -0.15,
216
+ war_loan: 0.1,
217
+ launch: 0.3,
194
218
  };
195
219
  const delta = SENTIMENT_DELTAS[action] ?? 0;
196
220
  if (delta !== 0) {
@@ -198,42 +222,37 @@ class StateProvider {
198
222
  }
199
223
  }
200
224
  onCheckpointDue = null;
201
- async refreshHoldings() {
202
- if (!this._state)
203
- return;
204
- const { TOKEN_2022_PROGRAM_ID } = await Promise.resolve().then(() => __importStar(require('@solana/spl-token')));
225
+ async getHoldings() {
226
+ const { TOKEN_2022_PROGRAM_ID } = await splTokenImport;
205
227
  const walletPk = new web3_js_1.PublicKey(this.publicKey);
206
- let walletValues = [];
207
- try {
208
- const walletAccounts = await this.connection.getParsedTokenAccountsByOwner(walletPk, {
228
+ // Parallel scan: wallet + vault
229
+ const stronghold = await this.getStronghold();
230
+ const scanWallet = this.connection
231
+ .getParsedTokenAccountsByOwner(walletPk, { programId: TOKEN_2022_PROGRAM_ID })
232
+ .then((r) => r.value)
233
+ .catch(() => []);
234
+ const scanVault = stronghold
235
+ ? this.connection
236
+ .getParsedTokenAccountsByOwner(new web3_js_1.PublicKey(stronghold.address), {
209
237
  programId: TOKEN_2022_PROGRAM_ID,
210
- });
211
- walletValues = walletAccounts.value;
212
- }
213
- catch { }
214
- let vaultValues = [];
215
- if (this._state.stronghold) {
216
- try {
217
- const vaultPk = new web3_js_1.PublicKey(this._state.stronghold.address);
218
- const vaultAccounts = await this.connection.getParsedTokenAccountsByOwner(vaultPk, {
219
- programId: TOKEN_2022_PROGRAM_ID,
220
- });
221
- vaultValues = vaultAccounts.value;
222
- }
223
- catch { }
224
- }
225
- const newHoldings = new Map();
238
+ })
239
+ .then((r) => r.value)
240
+ .catch(() => [])
241
+ : Promise.resolve([]);
242
+ const [walletValues, vaultValues] = await Promise.all([scanWallet, scanVault]);
243
+ const holdings = new Map();
226
244
  for (const a of [...walletValues, ...vaultValues]) {
227
245
  const mint = a.account.data.parsed.info.mint;
228
246
  const balance = Number(a.account.data.parsed.info.tokenAmount.uiAmount ?? 0);
229
247
  if (balance > 0 && (0, vanity_1.isPyreMint)(mint) && !(0, util_1.isBlacklistedMint)(mint)) {
230
- newHoldings.set(mint, (newHoldings.get(mint) ?? 0) + balance);
248
+ holdings.set(mint, (holdings.get(mint) ?? 0) + balance);
231
249
  }
232
250
  }
233
- this._state.holdings.clear();
234
- for (const [mint, balance] of newHoldings) {
235
- this._state.holdings.set(mint, balance);
236
- }
251
+ return holdings;
252
+ }
253
+ async getBalance(mint) {
254
+ const holdings = await this.getHoldings();
255
+ return holdings.get(mint) ?? 0;
237
256
  }
238
257
  getSentiment(mint) {
239
258
  return this._state?.sentiment.get(mint) ?? 0;
@@ -244,9 +263,6 @@ class StateProvider {
244
263
  get history() {
245
264
  return this._state?.recentHistory ?? [];
246
265
  }
247
- getBalance(mint) {
248
- return this._state?.holdings.get(mint) ?? 0;
249
- }
250
266
  hasVoted(mint) {
251
267
  return this._state?.voted.has(mint) ?? false;
252
268
  }
@@ -260,8 +276,8 @@ class StateProvider {
260
276
  this._state?.rallied.add(mint);
261
277
  }
262
278
  serialize() {
263
- if (!this._state) {
264
- return {
279
+ return !this._state
280
+ ? {
265
281
  publicKey: this.publicKey,
266
282
  vaultCreator: null,
267
283
  tick: 0,
@@ -276,33 +292,32 @@ class StateProvider {
276
292
  personalitySummary: null,
277
293
  totalSolSpent: 0,
278
294
  totalSolReceived: 0,
295
+ }
296
+ : {
297
+ publicKey: this._state.publicKey,
298
+ vaultCreator: this._vaultCreator ?? null,
299
+ tick: this._state.tick,
300
+ actionCounts: { ...this._state.actionCounts },
301
+ holdings: {},
302
+ activeLoans: Array.from(this._state.activeLoans),
303
+ founded: [...this._state.founded],
304
+ rallied: Array.from(this._state.rallied),
305
+ voted: Array.from(this._state.voted),
306
+ sentiment: Object.fromEntries(this._state.sentiment),
307
+ recentHistory: this._state.recentHistory.slice(-20),
308
+ personalitySummary: this._state.personalitySummary,
309
+ totalSolSpent: this._state.totalSolSpent,
310
+ totalSolReceived: this._state.totalSolReceived,
279
311
  };
280
- }
281
- return {
282
- publicKey: this._state.publicKey,
283
- vaultCreator: this._state.vaultCreator,
284
- tick: this._state.tick,
285
- actionCounts: { ...this._state.actionCounts },
286
- holdings: Object.fromEntries(this._state.holdings),
287
- activeLoans: Array.from(this._state.activeLoans),
288
- founded: [...this._state.founded],
289
- rallied: Array.from(this._state.rallied),
290
- voted: Array.from(this._state.voted),
291
- sentiment: Object.fromEntries(this._state.sentiment),
292
- recentHistory: this._state.recentHistory.slice(-20),
293
- personalitySummary: this._state.personalitySummary,
294
- totalSolSpent: this._state.totalSolSpent,
295
- totalSolReceived: this._state.totalSolReceived,
296
- };
297
312
  }
298
313
  hydrate(saved) {
314
+ if (saved.vaultCreator) {
315
+ this._vaultCreator = saved.vaultCreator;
316
+ }
299
317
  this._state = {
300
318
  publicKey: saved.publicKey,
301
- vaultCreator: saved.vaultCreator,
302
- stronghold: null, // will be resolved on next refreshHoldings or init
303
319
  tick: saved.tick,
304
320
  actionCounts: { ...EMPTY_COUNTS, ...saved.actionCounts },
305
- holdings: new Map(Object.entries(saved.holdings)),
306
321
  activeLoans: new Set(saved.activeLoans),
307
322
  founded: [...saved.founded],
308
323
  rallied: new Set(saved.rallied),
@@ -1,9 +1,10 @@
1
- import { AgentFactionPosition, AgentProfile, AllianceCluster, FactionPower, FactionStatus, RivalFaction, WorldEvent, WorldStats } from '../types';
1
+ import { AgentFactionPosition, AgentProfile, AllianceCluster, FactionListResult, FactionPower, FactionStatus, NearbyResult, RivalFaction, WorldEvent, WorldStats } from '../types';
2
2
  export interface Intel {
3
- getAgentFactions(wallet: string, factionLimit?: number): Promise<AgentFactionPosition[]>;
3
+ getAgentFactions(wallet: string): Promise<AgentFactionPosition[]>;
4
4
  getAgentProfile(wallet: string): Promise<AgentProfile>;
5
5
  getAgentSolLamports(wallet: string): Promise<number>;
6
6
  getAllies(mints: string[], holderLimit?: number): Promise<AllianceCluster[]>;
7
+ getAscendedFactions(limit?: number): Promise<FactionListResult>;
7
8
  getFactionPower(mint: string): Promise<FactionPower>;
8
9
  getFactionLeaderboard(opts?: {
9
10
  status?: FactionStatus;
@@ -12,6 +13,11 @@ export interface Intel {
12
13
  getFactionRivals(mint: string, opts?: {
13
14
  limit?: number;
14
15
  }): Promise<RivalFaction[]>;
16
+ getNearbyFactions(wallet: string, opts?: {
17
+ depth?: number;
18
+ limit?: number;
19
+ }): Promise<NearbyResult>;
20
+ getRisingFactions(limit?: number): Promise<FactionListResult>;
15
21
  getWorldFeed(opts?: {
16
22
  limit?: number;
17
23
  factionLimit?: number;
@@ -5,16 +5,10 @@ export type TrackedAction = 'join' | 'defect' | 'rally' | 'launch' | 'message' |
5
5
  export interface AgentGameState {
6
6
  /** Agent wallet public key */
7
7
  publicKey: string;
8
- /** Vault creator key (resolved from on-chain vault link) */
9
- vaultCreator: string | null;
10
- /** Vault info (null if no vault found) */
11
- stronghold: Stronghold | null;
12
8
  /** Monotonic tick counter — increments on each successful action */
13
9
  tick: number;
14
10
  /** Cumulative action counts keyed by action type */
15
11
  actionCounts: Record<TrackedAction, number>;
16
- /** Token holdings: mint → balance (wallet + vault combined) */
17
- holdings: Map<string, number>;
18
12
  /** Mints with active war loans */
19
13
  activeLoans: Set<string>;
20
14
  /** Mints this agent founded */
@@ -69,34 +63,35 @@ export interface CheckpointConfig {
69
63
  export interface State {
70
64
  /** Current game state (null before init) */
71
65
  readonly state: AgentGameState | null;
72
- /** Vault creator key (shorthand for state.vaultCreator) */
73
- readonly vaultCreator: string | null;
74
66
  /** Whether state has been initialized */
75
67
  readonly initialized: boolean;
76
68
  /** Current tick count */
77
69
  readonly tick: number;
78
70
  /**
79
71
  * Initialize state from chain.
80
- * Resolves vault link, loads holdings, loads action counts from registry checkpoint.
81
- * Must be called before any action. Returns the resolved state.
72
+ * Loads action counts from registry checkpoint.
73
+ * Vault and holdings are resolved lazily on first access.
82
74
  */
83
75
  init(): Promise<AgentGameState>;
84
76
  /**
85
77
  * Record a successful action — increments tick, updates action counts,
86
- * updates sentiment, appends to history, refreshes holdings.
87
- * Called by ActionProvider after tx confirmation.
78
+ * updates sentiment, appends to history.
88
79
  */
89
80
  record(action: TrackedAction, mint?: string, description?: string): Promise<void>;
90
- /** Refresh holdings from on-chain (wallet + vault token accounts) */
91
- refreshHoldings(): Promise<void>;
81
+ /** Get vault creator key (lazy resolves on first call, cached after) */
82
+ getVaultCreator(): Promise<string | null>;
83
+ /** Get stronghold info (lazy — resolves on first call, cached after) */
84
+ getStronghold(): Promise<Stronghold | null>;
85
+ /** Get token holdings fresh from chain (wallet + vault) */
86
+ getHoldings(): Promise<Map<string, number>>;
87
+ /** Get token balance for a specific mint (fresh from chain) */
88
+ getBalance(mint: string): Promise<number>;
92
89
  /** Get sentiment score for a faction (-10 to +10) */
93
90
  getSentiment(mint: string): number;
94
91
  /** Get all sentiment entries */
95
92
  readonly sentimentMap: ReadonlyMap<string, number>;
96
93
  /** Get recent action history (for LLM memory block) */
97
94
  readonly history: readonly string[];
98
- /** Get token balance for a specific mint */
99
- getBalance(mint: string): number;
100
95
  /** Check if agent has voted on a faction */
101
96
  hasVoted(mint: string): boolean;
102
97
  /** Check if agent has rallied a faction */
package/dist/types.d.ts CHANGED
@@ -327,6 +327,11 @@ export interface FactionPower {
327
327
  progress_percent: number;
328
328
  status: FactionStatus;
329
329
  }
330
+ /** Result from getNearbyFactions — factions + discovered agents in the social graph */
331
+ export interface NearbyResult extends FactionListResult {
332
+ /** Wallet addresses discovered as co-holders (natural allies) */
333
+ allies: string[];
334
+ }
330
335
  export interface AllianceCluster {
331
336
  factions: string[];
332
337
  shared_members: number;
package/dist/vanity.d.ts CHANGED
@@ -10,8 +10,8 @@ import type { CreateTokenResult, CreateTokenParams } from 'torchsdk';
10
10
  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
- /** Grind for a keypair whose base58 address ends with "py" */
13
+ /** Grind for a keypair whose base58 address ends with "pw" (pyreworld) */
14
14
  export declare const grindPyreMint: (maxAttempts?: number) => Keypair;
15
- /** Check if a mint address is a pyre faction (ends with "py") */
15
+ /** Check if a mint address is a pyre faction (ends with "pw") */
16
16
  export declare const isPyreMint: (mint: string) => boolean;
17
17
  export declare const buildCreateFactionTransaction: (connection: Connection, params: CreateTokenParams) => Promise<CreateTokenResult>;
package/dist/vanity.js CHANGED
@@ -34,22 +34,19 @@ const getTreasuryTokenAccount = (mint, treasury) => (0, spl_token_1.getAssociate
34
34
  const getTreasuryLockPda = (mint) => web3_js_1.PublicKey.findProgramAddressSync([Buffer.from(TREASURY_LOCK_SEED), mint.toBuffer()], torchsdk_1.PROGRAM_ID);
35
35
  exports.getTreasuryLockPda = getTreasuryLockPda;
36
36
  const getTreasuryLockTokenAccount = (mint, treasuryLock) => (0, spl_token_1.getAssociatedTokenAddressSync)(mint, treasuryLock, true, TOKEN_2022_PROGRAM_ID);
37
- const makeDummyProvider = (connection, payer) => {
38
- const dummyWallet = {
39
- publicKey: payer,
40
- signTransaction: async (t) => t,
41
- signAllTransactions: async (t) => t,
42
- };
43
- return new anchor_1.AnchorProvider(connection, dummyWallet, {});
44
- };
37
+ const makeDummyProvider = (connection, payer) => new anchor_1.AnchorProvider(connection, {
38
+ publicKey: payer,
39
+ signTransaction: async (t) => t,
40
+ signAllTransactions: async (t) => t,
41
+ }, {});
45
42
  const finalizeTransaction = async (connection, tx, feePayer) => {
46
43
  const { blockhash } = await connection.getLatestBlockhash();
47
44
  tx.recentBlockhash = blockhash;
48
45
  tx.feePayer = feePayer;
49
46
  };
50
47
  // ── Vanity grinder ──
51
- const PYRE_SUFFIX = 'py';
52
- /** Grind for a keypair whose base58 address ends with "py" */
48
+ const PYRE_SUFFIX = 'pw';
49
+ /** Grind for a keypair whose base58 address ends with "pw" (pyreworld) */
53
50
  const grindPyreMint = (maxAttempts = 500_000) => {
54
51
  for (let i = 0; i < maxAttempts; i++) {
55
52
  const kp = web3_js_1.Keypair.generate();
@@ -61,7 +58,7 @@ const grindPyreMint = (maxAttempts = 500_000) => {
61
58
  return web3_js_1.Keypair.generate();
62
59
  };
63
60
  exports.grindPyreMint = grindPyreMint;
64
- /** Check if a mint address is a pyre faction (ends with "py") */
61
+ /** Check if a mint address is a pyre faction (ends with "pw") */
65
62
  const isPyreMint = (mint) => mint.endsWith(PYRE_SUFFIX);
66
63
  exports.isPyreMint = isPyreMint;
67
64
  // ── Build create transaction with pyre vanity address ──
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyre-world-kit",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
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",