pyre-world-kit 1.0.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.
- package/dist/actions.d.ts +81 -0
- package/dist/actions.js +318 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +74 -0
- package/dist/intel.d.ts +61 -0
- package/dist/intel.js +342 -0
- package/dist/mappers.d.ts +31 -0
- package/dist/mappers.js +258 -0
- package/dist/types.d.ts +353 -0
- package/dist/types.js +9 -0
- package/dist/vanity.d.ts +14 -0
- package/dist/vanity.js +115 -0
- package/package.json +25 -0
- package/readme.md +203 -0
- package/src/actions.ts +523 -0
- package/src/index.ts +141 -0
- package/src/intel.ts +424 -0
- package/src/mappers.ts +302 -0
- package/src/types.ts +425 -0
- package/src/vanity.ts +159 -0
- package/tests/test_devnet_e2e.ts +401 -0
- package/tests/test_e2e.ts +213 -0
- package/tests/test_sim.ts +458 -0
- package/tsconfig.json +17 -0
package/src/mappers.ts
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pyre Kit Mappers
|
|
3
|
+
*
|
|
4
|
+
* Internal mapping functions between Torch SDK types and Pyre game types.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
TokenStatus,
|
|
9
|
+
TokenSummary,
|
|
10
|
+
TokenDetail,
|
|
11
|
+
TokenStatusFilter,
|
|
12
|
+
VaultInfo,
|
|
13
|
+
VaultWalletLinkInfo,
|
|
14
|
+
TokenMessage,
|
|
15
|
+
LendingInfo,
|
|
16
|
+
LoanPositionInfo,
|
|
17
|
+
LoanPositionWithKey,
|
|
18
|
+
Holder,
|
|
19
|
+
HoldersResult,
|
|
20
|
+
MessagesResult,
|
|
21
|
+
TokenListResult,
|
|
22
|
+
AllLoanPositionsResult,
|
|
23
|
+
BuyTransactionResult,
|
|
24
|
+
CreateTokenResult,
|
|
25
|
+
} from 'torchsdk';
|
|
26
|
+
|
|
27
|
+
import type {
|
|
28
|
+
FactionStatus,
|
|
29
|
+
FactionTier,
|
|
30
|
+
FactionStatusFilter,
|
|
31
|
+
Strategy,
|
|
32
|
+
FactionSummary,
|
|
33
|
+
FactionDetail,
|
|
34
|
+
Stronghold,
|
|
35
|
+
AgentLink,
|
|
36
|
+
Comms,
|
|
37
|
+
WarChest,
|
|
38
|
+
WarLoan,
|
|
39
|
+
WarLoanWithAgent,
|
|
40
|
+
Member,
|
|
41
|
+
FactionListResult,
|
|
42
|
+
MembersResult,
|
|
43
|
+
CommsResult,
|
|
44
|
+
AllWarLoansResult,
|
|
45
|
+
JoinFactionResult,
|
|
46
|
+
LaunchFactionResult,
|
|
47
|
+
} from './types';
|
|
48
|
+
|
|
49
|
+
// ─── Status Mapping ────────────────────────────────────────────────
|
|
50
|
+
|
|
51
|
+
const STATUS_MAP: Record<TokenStatus, FactionStatus> = {
|
|
52
|
+
bonding: 'rising',
|
|
53
|
+
complete: 'ready',
|
|
54
|
+
migrated: 'ascended',
|
|
55
|
+
reclaimed: 'razed',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const STATUS_REVERSE: Record<FactionStatus, TokenStatus> = {
|
|
59
|
+
rising: 'bonding',
|
|
60
|
+
ready: 'complete',
|
|
61
|
+
ascended: 'migrated',
|
|
62
|
+
razed: 'reclaimed',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const STATUS_FILTER_REVERSE: Record<FactionStatusFilter, TokenStatusFilter> = {
|
|
66
|
+
rising: 'bonding',
|
|
67
|
+
ready: 'complete',
|
|
68
|
+
ascended: 'migrated',
|
|
69
|
+
razed: 'reclaimed',
|
|
70
|
+
all: 'all',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export function mapFactionStatus(status: TokenStatus): FactionStatus {
|
|
74
|
+
return STATUS_MAP[status];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function mapTokenStatus(status: FactionStatus): TokenStatus {
|
|
78
|
+
return STATUS_REVERSE[status];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function mapTokenStatusFilter(status: FactionStatusFilter): TokenStatusFilter {
|
|
82
|
+
return STATUS_FILTER_REVERSE[status];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ─── Tier Mapping ──────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
/** Map SOL target to faction tier */
|
|
88
|
+
export function mapFactionTier(sol_target: number): FactionTier {
|
|
89
|
+
// Torch tiers: spark (≤50 SOL), flame (≤100 SOL), torch (200 SOL default)
|
|
90
|
+
if (sol_target <= 50_000_000_000) return 'ember'; // ≤50 SOL in lamports
|
|
91
|
+
if (sol_target <= 100_000_000_000) return 'blaze'; // ≤100 SOL
|
|
92
|
+
return 'inferno'; // 200 SOL (default)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Infer tier from sol_target in SOL (not lamports) */
|
|
96
|
+
export function mapFactionTierFromSol(sol_target: number): FactionTier {
|
|
97
|
+
if (sol_target <= 50) return 'ember';
|
|
98
|
+
if (sol_target <= 100) return 'blaze';
|
|
99
|
+
return 'inferno';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ─── Strategy Mapping ──────────────────────────────────────────────
|
|
103
|
+
|
|
104
|
+
export function mapStrategy(vote: 'burn' | 'return'): Strategy {
|
|
105
|
+
return vote === 'burn' ? 'scorched_earth' : 'fortify';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function mapVote(strategy: Strategy): 'burn' | 'return' {
|
|
109
|
+
return strategy === 'scorched_earth' ? 'burn' : 'return';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ─── Core Type Mappers ─────────────────────────────────────────────
|
|
113
|
+
|
|
114
|
+
export function mapTokenSummaryToFaction(t: TokenSummary): FactionSummary {
|
|
115
|
+
return {
|
|
116
|
+
mint: t.mint,
|
|
117
|
+
name: t.name,
|
|
118
|
+
symbol: t.symbol,
|
|
119
|
+
status: mapFactionStatus(t.status),
|
|
120
|
+
tier: mapFactionTierFromSol(t.market_cap_sol > 0 ? 200 : 200), // default tier from target
|
|
121
|
+
price_sol: t.price_sol,
|
|
122
|
+
market_cap_sol: t.market_cap_sol,
|
|
123
|
+
progress_percent: t.progress_percent,
|
|
124
|
+
members: t.holders,
|
|
125
|
+
created_at: t.created_at,
|
|
126
|
+
last_activity_at: t.last_activity_at,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function mapTokenDetailToFaction(t: TokenDetail): FactionDetail {
|
|
131
|
+
return {
|
|
132
|
+
mint: t.mint,
|
|
133
|
+
name: t.name,
|
|
134
|
+
symbol: t.symbol,
|
|
135
|
+
description: t.description,
|
|
136
|
+
image: t.image,
|
|
137
|
+
status: mapFactionStatus(t.status),
|
|
138
|
+
tier: mapFactionTierFromSol(t.sol_target),
|
|
139
|
+
price_sol: t.price_sol,
|
|
140
|
+
price_usd: t.price_usd,
|
|
141
|
+
market_cap_sol: t.market_cap_sol,
|
|
142
|
+
market_cap_usd: t.market_cap_usd,
|
|
143
|
+
progress_percent: t.progress_percent,
|
|
144
|
+
sol_raised: t.sol_raised,
|
|
145
|
+
sol_target: t.sol_target,
|
|
146
|
+
total_supply: t.total_supply,
|
|
147
|
+
circulating_supply: t.circulating_supply,
|
|
148
|
+
tokens_in_curve: t.tokens_in_curve,
|
|
149
|
+
tokens_in_vote_vault: t.tokens_in_vote_vault,
|
|
150
|
+
tokens_burned: t.tokens_burned,
|
|
151
|
+
war_chest_sol: t.treasury_sol_balance,
|
|
152
|
+
war_chest_tokens: t.treasury_token_balance,
|
|
153
|
+
total_bought_back: t.total_bought_back,
|
|
154
|
+
buyback_count: t.buyback_count,
|
|
155
|
+
votes_scorched_earth: t.votes_burn,
|
|
156
|
+
votes_fortify: t.votes_return,
|
|
157
|
+
founder: t.creator,
|
|
158
|
+
members: t.holders,
|
|
159
|
+
rallies: t.stars,
|
|
160
|
+
created_at: t.created_at,
|
|
161
|
+
last_activity_at: t.last_activity_at,
|
|
162
|
+
twitter: t.twitter,
|
|
163
|
+
telegram: t.telegram,
|
|
164
|
+
website: t.website,
|
|
165
|
+
founder_verified: t.creator_verified,
|
|
166
|
+
founder_trust_tier: t.creator_trust_tier,
|
|
167
|
+
founder_said_name: t.creator_said_name,
|
|
168
|
+
founder_badge_url: t.creator_badge_url,
|
|
169
|
+
warnings: t.warnings,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function mapVaultToStronghold(v: VaultInfo): Stronghold {
|
|
174
|
+
return {
|
|
175
|
+
address: v.address,
|
|
176
|
+
creator: v.creator,
|
|
177
|
+
authority: v.authority,
|
|
178
|
+
sol_balance: v.sol_balance,
|
|
179
|
+
total_deposited: v.total_deposited,
|
|
180
|
+
total_withdrawn: v.total_withdrawn,
|
|
181
|
+
total_spent: v.total_spent,
|
|
182
|
+
total_received: v.total_received,
|
|
183
|
+
linked_agents: v.linked_wallets,
|
|
184
|
+
created_at: v.created_at,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function mapWalletLinkToAgentLink(l: VaultWalletLinkInfo): AgentLink {
|
|
189
|
+
return {
|
|
190
|
+
address: l.address,
|
|
191
|
+
stronghold: l.vault,
|
|
192
|
+
wallet: l.wallet,
|
|
193
|
+
linked_at: l.linked_at,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function mapTokenMessageToComms(m: TokenMessage): Comms {
|
|
198
|
+
return {
|
|
199
|
+
signature: m.signature,
|
|
200
|
+
memo: m.memo,
|
|
201
|
+
sender: m.sender,
|
|
202
|
+
timestamp: m.timestamp,
|
|
203
|
+
sender_verified: m.sender_verified,
|
|
204
|
+
sender_trust_tier: m.sender_trust_tier,
|
|
205
|
+
sender_said_name: m.sender_said_name,
|
|
206
|
+
sender_badge_url: m.sender_badge_url,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function mapLendingToWarChest(l: LendingInfo): WarChest {
|
|
211
|
+
return {
|
|
212
|
+
interest_rate_bps: l.interest_rate_bps,
|
|
213
|
+
max_ltv_bps: l.max_ltv_bps,
|
|
214
|
+
liquidation_threshold_bps: l.liquidation_threshold_bps,
|
|
215
|
+
liquidation_bonus_bps: l.liquidation_bonus_bps,
|
|
216
|
+
utilization_cap_bps: l.utilization_cap_bps,
|
|
217
|
+
borrow_share_multiplier: l.borrow_share_multiplier,
|
|
218
|
+
total_sol_lent: l.total_sol_lent,
|
|
219
|
+
active_loans: l.active_loans,
|
|
220
|
+
war_chest_sol_available: l.treasury_sol_available,
|
|
221
|
+
warnings: l.warnings,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export function mapLoanToWarLoan(l: LoanPositionInfo): WarLoan {
|
|
226
|
+
return {
|
|
227
|
+
collateral_amount: l.collateral_amount,
|
|
228
|
+
borrowed_amount: l.borrowed_amount,
|
|
229
|
+
accrued_interest: l.accrued_interest,
|
|
230
|
+
total_owed: l.total_owed,
|
|
231
|
+
collateral_value_sol: l.collateral_value_sol,
|
|
232
|
+
current_ltv_bps: l.current_ltv_bps,
|
|
233
|
+
health: l.health,
|
|
234
|
+
warnings: l.warnings,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function mapLoanWithKeyToWarLoan(l: LoanPositionWithKey): WarLoanWithAgent {
|
|
239
|
+
return {
|
|
240
|
+
...mapLoanToWarLoan(l),
|
|
241
|
+
borrower: l.borrower,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export function mapHolderToMember(h: Holder): Member {
|
|
246
|
+
return {
|
|
247
|
+
address: h.address,
|
|
248
|
+
balance: h.balance,
|
|
249
|
+
percentage: h.percentage,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// ─── Result Mappers ────────────────────────────────────────────────
|
|
254
|
+
|
|
255
|
+
export function mapTokenListResult(r: TokenListResult): FactionListResult {
|
|
256
|
+
return {
|
|
257
|
+
factions: r.tokens.map(mapTokenSummaryToFaction),
|
|
258
|
+
total: r.total,
|
|
259
|
+
limit: r.limit,
|
|
260
|
+
offset: r.offset,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function mapHoldersResult(r: HoldersResult): MembersResult {
|
|
265
|
+
return {
|
|
266
|
+
members: r.holders.map(mapHolderToMember),
|
|
267
|
+
total_members: r.total_holders,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function mapMessagesResult(r: MessagesResult): CommsResult {
|
|
272
|
+
return {
|
|
273
|
+
comms: r.messages.map(mapTokenMessageToComms),
|
|
274
|
+
total: r.total,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export function mapAllLoansResult(r: AllLoanPositionsResult): AllWarLoansResult {
|
|
279
|
+
return {
|
|
280
|
+
positions: r.positions.map(mapLoanWithKeyToWarLoan),
|
|
281
|
+
pool_price_sol: r.pool_price_sol,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export function mapBuyResult(r: BuyTransactionResult): JoinFactionResult {
|
|
286
|
+
return {
|
|
287
|
+
transaction: r.transaction,
|
|
288
|
+
additionalTransactions: r.additionalTransactions,
|
|
289
|
+
message: r.message,
|
|
290
|
+
migrationTransaction: r.migrationTransaction,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export function mapCreateResult(r: CreateTokenResult): LaunchFactionResult {
|
|
295
|
+
return {
|
|
296
|
+
transaction: r.transaction,
|
|
297
|
+
additionalTransactions: r.additionalTransactions,
|
|
298
|
+
message: r.message,
|
|
299
|
+
mint: r.mint,
|
|
300
|
+
mintKeypair: r.mintKeypair,
|
|
301
|
+
};
|
|
302
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pyre Kit Types
|
|
3
|
+
*
|
|
4
|
+
* Game-semantic wrappers over torchsdk types.
|
|
5
|
+
* Torch Market IS the game engine — these types translate
|
|
6
|
+
* protocol primitives into faction warfare language.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { Transaction, Keypair, PublicKey } from '@solana/web3.js';
|
|
10
|
+
import type {
|
|
11
|
+
TokenSortOption,
|
|
12
|
+
TransactionResult,
|
|
13
|
+
CreateTokenResult,
|
|
14
|
+
SaidVerification,
|
|
15
|
+
ConfirmResult,
|
|
16
|
+
EphemeralAgent,
|
|
17
|
+
} from 'torchsdk';
|
|
18
|
+
|
|
19
|
+
// ─── Status & Tier Enums ───────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
/** Faction lifecycle: rising (bonding) → ready (complete) → ascended (migrated) → razed (reclaimed) */
|
|
22
|
+
export type FactionStatus = 'rising' | 'ready' | 'ascended' | 'razed';
|
|
23
|
+
|
|
24
|
+
/** Faction tier based on SOL target: ember (spark) → blaze (flame) → inferno (torch) */
|
|
25
|
+
export type FactionTier = 'ember' | 'blaze' | 'inferno';
|
|
26
|
+
|
|
27
|
+
/** Governance strategy: scorched_earth (burn tokens) or fortify (return to treasury lock) */
|
|
28
|
+
export type Strategy = 'scorched_earth' | 'fortify';
|
|
29
|
+
|
|
30
|
+
/** Agent loan health status */
|
|
31
|
+
export type AgentHealth = 'healthy' | 'at_risk' | 'liquidatable' | 'none';
|
|
32
|
+
|
|
33
|
+
// ─── Core Game Types ───────────────────────────────────────────────
|
|
34
|
+
|
|
35
|
+
/** Summary view of a faction (wraps TokenSummary) */
|
|
36
|
+
export interface FactionSummary {
|
|
37
|
+
mint: string;
|
|
38
|
+
name: string;
|
|
39
|
+
symbol: string;
|
|
40
|
+
status: FactionStatus;
|
|
41
|
+
tier: FactionTier;
|
|
42
|
+
price_sol: number;
|
|
43
|
+
market_cap_sol: number;
|
|
44
|
+
progress_percent: number;
|
|
45
|
+
members: number | null;
|
|
46
|
+
created_at: number;
|
|
47
|
+
last_activity_at: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Detailed view of a faction (wraps TokenDetail) */
|
|
51
|
+
export interface FactionDetail {
|
|
52
|
+
mint: string;
|
|
53
|
+
name: string;
|
|
54
|
+
symbol: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
image?: string;
|
|
57
|
+
status: FactionStatus;
|
|
58
|
+
tier: FactionTier;
|
|
59
|
+
price_sol: number;
|
|
60
|
+
price_usd?: number;
|
|
61
|
+
market_cap_sol: number;
|
|
62
|
+
market_cap_usd?: number;
|
|
63
|
+
progress_percent: number;
|
|
64
|
+
sol_raised: number;
|
|
65
|
+
sol_target: number;
|
|
66
|
+
total_supply: number;
|
|
67
|
+
circulating_supply: number;
|
|
68
|
+
tokens_in_curve: number;
|
|
69
|
+
tokens_in_vote_vault: number;
|
|
70
|
+
tokens_burned: number;
|
|
71
|
+
war_chest_sol: number;
|
|
72
|
+
war_chest_tokens: number;
|
|
73
|
+
total_bought_back: number;
|
|
74
|
+
buyback_count: number;
|
|
75
|
+
votes_scorched_earth: number;
|
|
76
|
+
votes_fortify: number;
|
|
77
|
+
founder: string;
|
|
78
|
+
members: number | null;
|
|
79
|
+
rallies: number;
|
|
80
|
+
created_at: number;
|
|
81
|
+
last_activity_at: number;
|
|
82
|
+
twitter?: string;
|
|
83
|
+
telegram?: string;
|
|
84
|
+
website?: string;
|
|
85
|
+
founder_verified?: boolean;
|
|
86
|
+
founder_trust_tier?: 'high' | 'medium' | 'low' | null;
|
|
87
|
+
founder_said_name?: string;
|
|
88
|
+
founder_badge_url?: string;
|
|
89
|
+
warnings?: string[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Agent stronghold (wraps VaultInfo) */
|
|
93
|
+
export interface Stronghold {
|
|
94
|
+
address: string;
|
|
95
|
+
creator: string;
|
|
96
|
+
authority: string;
|
|
97
|
+
sol_balance: number;
|
|
98
|
+
total_deposited: number;
|
|
99
|
+
total_withdrawn: number;
|
|
100
|
+
total_spent: number;
|
|
101
|
+
total_received: number;
|
|
102
|
+
linked_agents: number;
|
|
103
|
+
created_at: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Agent wallet link (wraps VaultWalletLinkInfo) */
|
|
107
|
+
export interface AgentLink {
|
|
108
|
+
address: string;
|
|
109
|
+
stronghold: string;
|
|
110
|
+
wallet: string;
|
|
111
|
+
linked_at: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Faction communication (wraps TokenMessage) */
|
|
115
|
+
export interface Comms {
|
|
116
|
+
signature: string;
|
|
117
|
+
memo: string;
|
|
118
|
+
sender: string;
|
|
119
|
+
timestamp: number;
|
|
120
|
+
sender_verified?: boolean;
|
|
121
|
+
sender_trust_tier?: 'high' | 'medium' | 'low' | null;
|
|
122
|
+
sender_said_name?: string;
|
|
123
|
+
sender_badge_url?: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** War chest lending info (wraps LendingInfo) */
|
|
127
|
+
export interface WarChest {
|
|
128
|
+
interest_rate_bps: number;
|
|
129
|
+
max_ltv_bps: number;
|
|
130
|
+
liquidation_threshold_bps: number;
|
|
131
|
+
liquidation_bonus_bps: number;
|
|
132
|
+
utilization_cap_bps: number;
|
|
133
|
+
borrow_share_multiplier: number;
|
|
134
|
+
total_sol_lent: number | null;
|
|
135
|
+
active_loans: number | null;
|
|
136
|
+
war_chest_sol_available: number;
|
|
137
|
+
warnings?: string[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** War loan position (wraps LoanPositionInfo) */
|
|
141
|
+
export interface WarLoan {
|
|
142
|
+
collateral_amount: number;
|
|
143
|
+
borrowed_amount: number;
|
|
144
|
+
accrued_interest: number;
|
|
145
|
+
total_owed: number;
|
|
146
|
+
collateral_value_sol: number | null;
|
|
147
|
+
current_ltv_bps: number | null;
|
|
148
|
+
health: AgentHealth;
|
|
149
|
+
warnings?: string[];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** War loan with borrower key (wraps LoanPositionWithKey) */
|
|
153
|
+
export interface WarLoanWithAgent extends WarLoan {
|
|
154
|
+
borrower: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Faction member (wraps Holder) */
|
|
158
|
+
export interface Member {
|
|
159
|
+
address: string;
|
|
160
|
+
balance: number;
|
|
161
|
+
percentage: number;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// ─── List Results ──────────────────────────────────────────────────
|
|
165
|
+
|
|
166
|
+
export interface FactionListResult {
|
|
167
|
+
factions: FactionSummary[];
|
|
168
|
+
total: number;
|
|
169
|
+
limit: number;
|
|
170
|
+
offset: number;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface MembersResult {
|
|
174
|
+
members: Member[];
|
|
175
|
+
total_members: number;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface CommsResult {
|
|
179
|
+
comms: Comms[];
|
|
180
|
+
total: number;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface AllWarLoansResult {
|
|
184
|
+
positions: WarLoanWithAgent[];
|
|
185
|
+
pool_price_sol: number | null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ─── Action Params ─────────────────────────────────────────────────
|
|
189
|
+
|
|
190
|
+
export interface LaunchFactionParams {
|
|
191
|
+
founder: string;
|
|
192
|
+
name: string;
|
|
193
|
+
symbol: string;
|
|
194
|
+
metadata_uri: string;
|
|
195
|
+
sol_target?: number;
|
|
196
|
+
community_faction?: boolean;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface JoinFactionParams {
|
|
200
|
+
mint: string;
|
|
201
|
+
agent: string;
|
|
202
|
+
amount_sol: number;
|
|
203
|
+
slippage_bps?: number;
|
|
204
|
+
strategy?: Strategy;
|
|
205
|
+
message?: string;
|
|
206
|
+
stronghold: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface DirectJoinFactionParams {
|
|
210
|
+
mint: string;
|
|
211
|
+
agent: string;
|
|
212
|
+
amount_sol: number;
|
|
213
|
+
slippage_bps?: number;
|
|
214
|
+
strategy?: Strategy;
|
|
215
|
+
message?: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface DefectParams {
|
|
219
|
+
mint: string;
|
|
220
|
+
agent: string;
|
|
221
|
+
amount_tokens: number;
|
|
222
|
+
slippage_bps?: number;
|
|
223
|
+
message?: string;
|
|
224
|
+
stronghold?: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface RallyParams {
|
|
228
|
+
mint: string;
|
|
229
|
+
agent: string;
|
|
230
|
+
stronghold?: string;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface RequestWarLoanParams {
|
|
234
|
+
mint: string;
|
|
235
|
+
borrower: string;
|
|
236
|
+
collateral_amount: number;
|
|
237
|
+
sol_to_borrow: number;
|
|
238
|
+
stronghold?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface RepayWarLoanParams {
|
|
242
|
+
mint: string;
|
|
243
|
+
borrower: string;
|
|
244
|
+
sol_amount: number;
|
|
245
|
+
stronghold?: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface SiegeParams {
|
|
249
|
+
mint: string;
|
|
250
|
+
liquidator: string;
|
|
251
|
+
borrower: string;
|
|
252
|
+
stronghold?: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface TradeOnDexParams {
|
|
256
|
+
mint: string;
|
|
257
|
+
signer: string;
|
|
258
|
+
stronghold_creator: string;
|
|
259
|
+
amount_in: number;
|
|
260
|
+
minimum_amount_out: number;
|
|
261
|
+
is_buy: boolean;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface ClaimSpoilsParams {
|
|
265
|
+
agent: string;
|
|
266
|
+
stronghold?: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface CreateStrongholdParams {
|
|
270
|
+
creator: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface FundStrongholdParams {
|
|
274
|
+
depositor: string;
|
|
275
|
+
stronghold_creator: string;
|
|
276
|
+
amount_sol: number;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface WithdrawFromStrongholdParams {
|
|
280
|
+
authority: string;
|
|
281
|
+
stronghold_creator: string;
|
|
282
|
+
amount_sol: number;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface RecruitAgentParams {
|
|
286
|
+
authority: string;
|
|
287
|
+
stronghold_creator: string;
|
|
288
|
+
wallet_to_link: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface ExileAgentParams {
|
|
292
|
+
authority: string;
|
|
293
|
+
stronghold_creator: string;
|
|
294
|
+
wallet_to_unlink: string;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export interface CoupParams {
|
|
298
|
+
authority: string;
|
|
299
|
+
stronghold_creator: string;
|
|
300
|
+
new_authority: string;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface WithdrawAssetsParams {
|
|
304
|
+
authority: string;
|
|
305
|
+
stronghold_creator: string;
|
|
306
|
+
mint: string;
|
|
307
|
+
destination: string;
|
|
308
|
+
amount: number;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface AscendParams {
|
|
312
|
+
mint: string;
|
|
313
|
+
payer: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface RazeParams {
|
|
317
|
+
payer: string;
|
|
318
|
+
mint: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface TitheParams {
|
|
322
|
+
mint: string;
|
|
323
|
+
payer: string;
|
|
324
|
+
sources?: string[];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface ConvertTitheParams {
|
|
328
|
+
mint: string;
|
|
329
|
+
payer: string;
|
|
330
|
+
minimum_amount_out?: number;
|
|
331
|
+
harvest?: boolean;
|
|
332
|
+
sources?: string[];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// ─── Action Results ────────────────────────────────────────────────
|
|
336
|
+
|
|
337
|
+
/** Re-export base result types with game names */
|
|
338
|
+
export type { TransactionResult, CreateTokenResult, EphemeralAgent, SaidVerification, ConfirmResult };
|
|
339
|
+
|
|
340
|
+
export interface JoinFactionResult extends TransactionResult {
|
|
341
|
+
migrationTransaction?: Transaction;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface LaunchFactionResult extends TransactionResult {
|
|
345
|
+
mint: PublicKey;
|
|
346
|
+
mintKeypair: Keypair;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// ─── List/Filter Params ────────────────────────────────────────────
|
|
350
|
+
|
|
351
|
+
export type FactionSortOption = TokenSortOption;
|
|
352
|
+
export type FactionStatusFilter = 'rising' | 'ready' | 'ascended' | 'razed' | 'all';
|
|
353
|
+
|
|
354
|
+
export interface FactionListParams {
|
|
355
|
+
limit?: number;
|
|
356
|
+
offset?: number;
|
|
357
|
+
status?: FactionStatusFilter;
|
|
358
|
+
sort?: FactionSortOption;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// ─── Intel Types ───────────────────────────────────────────────────
|
|
362
|
+
|
|
363
|
+
export interface FactionPower {
|
|
364
|
+
mint: string;
|
|
365
|
+
name: string;
|
|
366
|
+
symbol: string;
|
|
367
|
+
score: number;
|
|
368
|
+
market_cap_sol: number;
|
|
369
|
+
members: number;
|
|
370
|
+
war_chest_sol: number;
|
|
371
|
+
rallies: number;
|
|
372
|
+
progress_percent: number;
|
|
373
|
+
status: FactionStatus;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export interface AllianceCluster {
|
|
377
|
+
factions: string[];
|
|
378
|
+
shared_members: number;
|
|
379
|
+
overlap_percent: number;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export interface RivalFaction {
|
|
383
|
+
mint: string;
|
|
384
|
+
name: string;
|
|
385
|
+
symbol: string;
|
|
386
|
+
defections_in: number;
|
|
387
|
+
defections_out: number;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export interface AgentProfile {
|
|
391
|
+
wallet: string;
|
|
392
|
+
stronghold: Stronghold | null;
|
|
393
|
+
factions_joined: AgentFactionPosition[];
|
|
394
|
+
factions_founded: string[];
|
|
395
|
+
said_verification: SaidVerification | null;
|
|
396
|
+
total_value_sol: number;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export interface AgentFactionPosition {
|
|
400
|
+
mint: string;
|
|
401
|
+
name: string;
|
|
402
|
+
symbol: string;
|
|
403
|
+
balance: number;
|
|
404
|
+
percentage: number;
|
|
405
|
+
value_sol: number;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export interface WorldEvent {
|
|
409
|
+
type: 'launch' | 'join' | 'defect' | 'rally' | 'ascend' | 'raze';
|
|
410
|
+
faction_mint: string;
|
|
411
|
+
faction_name: string;
|
|
412
|
+
agent?: string;
|
|
413
|
+
amount_sol?: number;
|
|
414
|
+
timestamp: number;
|
|
415
|
+
signature?: string;
|
|
416
|
+
message?: string;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export interface WorldStats {
|
|
420
|
+
total_factions: number;
|
|
421
|
+
rising_factions: number;
|
|
422
|
+
ascended_factions: number;
|
|
423
|
+
total_sol_locked: number;
|
|
424
|
+
most_powerful: FactionPower | null;
|
|
425
|
+
}
|