pyre-world-kit 1.0.19 → 1.0.21
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/dist/actions.d.ts +2 -2
- package/dist/actions.js +5 -2
- package/dist/intel.js +6 -8
- package/package.json +2 -2
- package/src/actions.ts +6 -1
- package/src/intel.ts +6 -9
package/dist/actions.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
8
8
|
import type { BuyQuoteResult, SellQuoteResult, TransactionResult, SaidVerification, ConfirmResult } from 'torchsdk';
|
|
9
|
-
import type { FactionListParams, FactionListResult, FactionDetail, MembersResult, CommsResult, Stronghold, AgentLink, WarChest, WarLoan, WarLoanQuote, AllWarLoansResult, LaunchFactionParams, JoinFactionParams, DirectJoinFactionParams, DefectParams, MessageFactionParams, FudFactionParams, RallyParams, RequestWarLoanParams, RepayWarLoanParams, SiegeParams, TradeOnDexParams, ClaimSpoilsParams, CreateStrongholdParams, FundStrongholdParams, WithdrawFromStrongholdParams, RecruitAgentParams, ExileAgentParams, CoupParams, WithdrawAssetsParams, AscendParams, RazeParams, TitheParams, ConvertTitheParams, JoinFactionResult, LaunchFactionResult } from './types';
|
|
9
|
+
import type { FactionListParams, FactionListResult, FactionDetail, MembersResult, CommsResult, Stronghold, AgentLink, WarChest, WarLoan, WarLoanQuote, AllWarLoansResult, LaunchFactionParams, JoinFactionParams, DirectJoinFactionParams, DefectParams, MessageFactionParams, FudFactionParams, RallyParams, RequestWarLoanParams, RepayWarLoanParams, SiegeParams, TradeOnDexParams, ClaimSpoilsParams, CreateStrongholdParams, FundStrongholdParams, WithdrawFromStrongholdParams, RecruitAgentParams, ExileAgentParams, CoupParams, WithdrawAssetsParams, AscendParams, RazeParams, TitheParams, ConvertTitheParams, JoinFactionResult, LaunchFactionResult, FactionStatus } from './types';
|
|
10
10
|
/** Add mints to the blacklist (call at startup with old mints) */
|
|
11
11
|
export declare function blacklistMints(mints: string[]): void;
|
|
12
12
|
/** Check if a mint is blacklisted */
|
|
@@ -20,7 +20,7 @@ export declare function getFaction(connection: Connection, mint: string): Promis
|
|
|
20
20
|
/** Get faction members (top holders, excluding program-owned accounts) */
|
|
21
21
|
export declare function getMembers(connection: Connection, mint: string, limit?: number): Promise<MembersResult>;
|
|
22
22
|
/** Get faction comms (trade-bundled messages, including post-ascension DEX messages) */
|
|
23
|
-
export declare function getComms(connection: Connection, mint: string, limit?: number): Promise<CommsResult>;
|
|
23
|
+
export declare function getComms(connection: Connection, mint: string, limit?: number, status?: FactionStatus): Promise<CommsResult>;
|
|
24
24
|
/** Get a quote for joining a faction (buying tokens) */
|
|
25
25
|
export declare function getJoinQuote(connection: Connection, mint: string, amountSolLamports: number): Promise<BuyQuoteResult>;
|
|
26
26
|
/** Get a quote for defecting from a faction (selling tokens) */
|
package/dist/actions.js
CHANGED
|
@@ -132,8 +132,11 @@ async function getMembers(connection, mint, limit) {
|
|
|
132
132
|
return (0, mappers_1.mapHoldersResult)(result);
|
|
133
133
|
}
|
|
134
134
|
/** Get faction comms (trade-bundled messages, including post-ascension DEX messages) */
|
|
135
|
-
async function getComms(connection, mint, limit) {
|
|
136
|
-
|
|
135
|
+
async function getComms(connection, mint, limit, status) {
|
|
136
|
+
// Non-ascended: bonding curve only (1 RPC call)
|
|
137
|
+
// Ascended: pool only (1 RPC call) — bonding curve is stale post-migration
|
|
138
|
+
const source = status === 'ascended' ? 'pool' : status ? 'bonding' : 'all';
|
|
139
|
+
const result = await (0, torchsdk_1.getMessages)(connection, mint, limit, { source });
|
|
137
140
|
return (0, mappers_1.mapMessagesResult)(result);
|
|
138
141
|
}
|
|
139
142
|
/** Get a quote for joining a faction (buying tokens) */
|
package/dist/intel.js
CHANGED
|
@@ -55,7 +55,9 @@ async function getFactionLeaderboard(connection, opts) {
|
|
|
55
55
|
razed: 'reclaimed',
|
|
56
56
|
};
|
|
57
57
|
const sdkStatus = opts?.status ? statusMap[opts.status] : 'all';
|
|
58
|
-
|
|
58
|
+
// Fetch more than requested to account for non-pyre tokens being filtered out
|
|
59
|
+
const fetchLimit = Math.min((opts?.limit ?? 20) * 3, 100);
|
|
60
|
+
const result = await (0, torchsdk_1.getTokens)(connection, { limit: fetchLimit, status: sdkStatus });
|
|
59
61
|
const pyreFactions = result.tokens.filter(t => (0, vanity_1.isPyreMint)(t.mint));
|
|
60
62
|
const powers = pyreFactions.map((t) => ({
|
|
61
63
|
mint: t.mint,
|
|
@@ -287,14 +289,10 @@ async function getWorldFeed(connection, opts) {
|
|
|
287
289
|
* Global stats: total factions, total agents, total SOL locked.
|
|
288
290
|
*/
|
|
289
291
|
async function getWorldStats(connection) {
|
|
290
|
-
const
|
|
291
|
-
(0, torchsdk_1.getTokens)(connection, { limit: 200, status: 'all' }),
|
|
292
|
-
(0, torchsdk_1.getTokens)(connection, { limit: 100, status: 'bonding' }),
|
|
293
|
-
(0, torchsdk_1.getTokens)(connection, { limit: 100, status: 'migrated' }),
|
|
294
|
-
]);
|
|
292
|
+
const all = await (0, torchsdk_1.getTokens)(connection, { limit: 200, status: 'all' });
|
|
295
293
|
const pyreAll = all.tokens.filter(t => (0, vanity_1.isPyreMint)(t.mint));
|
|
296
|
-
const pyreRising =
|
|
297
|
-
const pyreAscended =
|
|
294
|
+
const pyreRising = pyreAll.filter(t => t.status === 'bonding');
|
|
295
|
+
const pyreAscended = pyreAll.filter(t => t.status === 'migrated');
|
|
298
296
|
const allFactions = [...pyreRising, ...pyreAscended];
|
|
299
297
|
const totalSolLocked = allFactions.reduce((sum, t) => sum + t.market_cap_sol, 0);
|
|
300
298
|
// Find most powerful
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pyre-world-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
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",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@solana/spl-token": "^0.4.6",
|
|
16
16
|
"@solana/web3.js": "^1.98.4",
|
|
17
17
|
"bs58": "^6.0.0",
|
|
18
|
-
"torchsdk": "^3.7.
|
|
18
|
+
"torchsdk": "^3.7.36"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^22.15.0",
|
package/src/actions.ts
CHANGED
|
@@ -88,6 +88,7 @@ import type {
|
|
|
88
88
|
ConvertTitheParams,
|
|
89
89
|
JoinFactionResult,
|
|
90
90
|
LaunchFactionResult,
|
|
91
|
+
FactionStatus,
|
|
91
92
|
} from './types';
|
|
92
93
|
|
|
93
94
|
import {
|
|
@@ -209,8 +210,12 @@ export async function getComms(
|
|
|
209
210
|
connection: Connection,
|
|
210
211
|
mint: string,
|
|
211
212
|
limit?: number,
|
|
213
|
+
status?: FactionStatus,
|
|
212
214
|
): Promise<CommsResult> {
|
|
213
|
-
|
|
215
|
+
// Non-ascended: bonding curve only (1 RPC call)
|
|
216
|
+
// Ascended: pool only (1 RPC call) — bonding curve is stale post-migration
|
|
217
|
+
const source = status === 'ascended' ? 'pool' : status ? 'bonding' : 'all';
|
|
218
|
+
const result = await getMessages(connection, mint, limit, { source });
|
|
214
219
|
return mapMessagesResult(result);
|
|
215
220
|
}
|
|
216
221
|
|
package/src/intel.ts
CHANGED
|
@@ -75,7 +75,9 @@ export async function getFactionLeaderboard(
|
|
|
75
75
|
razed: 'reclaimed',
|
|
76
76
|
};
|
|
77
77
|
const sdkStatus = opts?.status ? statusMap[opts.status] as any : 'all';
|
|
78
|
-
|
|
78
|
+
// Fetch more than requested to account for non-pyre tokens being filtered out
|
|
79
|
+
const fetchLimit = Math.min((opts?.limit ?? 20) * 3, 100);
|
|
80
|
+
const result = await getTokens(connection, { limit: fetchLimit, status: sdkStatus });
|
|
79
81
|
const pyreFactions = result.tokens.filter(t => isPyreMint(t.mint));
|
|
80
82
|
|
|
81
83
|
const powers: FactionPower[] = pyreFactions.map((t) => ({
|
|
@@ -357,15 +359,10 @@ export async function getWorldFeed(
|
|
|
357
359
|
export async function getWorldStats(
|
|
358
360
|
connection: Connection,
|
|
359
361
|
): Promise<WorldStats> {
|
|
360
|
-
const
|
|
361
|
-
getTokens(connection, { limit: 200, status: 'all' }),
|
|
362
|
-
getTokens(connection, { limit: 100, status: 'bonding' }),
|
|
363
|
-
getTokens(connection, { limit: 100, status: 'migrated' }),
|
|
364
|
-
]);
|
|
365
|
-
|
|
362
|
+
const all = await getTokens(connection, { limit: 200, status: 'all' });
|
|
366
363
|
const pyreAll = all.tokens.filter(t => isPyreMint(t.mint));
|
|
367
|
-
const pyreRising =
|
|
368
|
-
const pyreAscended =
|
|
364
|
+
const pyreRising = pyreAll.filter(t => t.status === 'bonding');
|
|
365
|
+
const pyreAscended = pyreAll.filter(t => t.status === 'migrated');
|
|
369
366
|
const allFactions = [...pyreRising, ...pyreAscended];
|
|
370
367
|
const totalSolLocked = allFactions.reduce((sum, t) => sum + t.market_cap_sol, 0);
|
|
371
368
|
|