pyre-world-kit 1.0.20 → 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/package.json +2 -2
- package/src/actions.ts +6 -1
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/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
|
|