pyre-world-kit 2.0.11 → 3.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/.prettierrc.json +6 -0
- package/dist/actions.js +16 -0
- package/dist/index.d.ts +38 -4
- package/dist/index.js +100 -85
- package/dist/providers/action.provider.d.ts +46 -0
- package/dist/providers/action.provider.js +331 -0
- package/dist/providers/intel.provider.d.ts +29 -0
- package/dist/providers/intel.provider.js +363 -0
- package/dist/providers/mapper.provider.d.ts +197 -0
- package/dist/providers/mapper.provider.js +158 -0
- package/dist/providers/registry.provider.d.ts +25 -0
- package/dist/providers/registry.provider.js +229 -0
- package/dist/providers/state.provider.d.ts +42 -0
- package/dist/providers/state.provider.js +348 -0
- package/dist/pyre_world.json +34 -229
- package/dist/types/action.types.d.ts +41 -0
- package/dist/types/action.types.js +2 -0
- package/dist/types/intel.types.d.ts +20 -0
- package/dist/types/intel.types.js +2 -0
- package/dist/types/mapper.types.d.ts +27 -0
- package/dist/types/mapper.types.js +22 -0
- package/dist/types/registry.types.d.ts +0 -0
- package/dist/types/registry.types.js +1 -0
- package/dist/types/state.types.d.ts +112 -0
- package/dist/types/state.types.js +2 -0
- package/dist/types.d.ts +8 -24
- package/dist/util.d.ts +29 -0
- package/dist/util.js +144 -0
- package/dist/vanity.d.ts +3 -3
- package/dist/vanity.js +18 -15
- package/package.json +4 -2
- package/readme.md +134 -122
- package/src/index.ts +127 -92
- package/src/providers/action.provider.ts +443 -0
- package/src/providers/intel.provider.ts +383 -0
- package/src/providers/mapper.provider.ts +195 -0
- package/src/providers/registry.provider.ts +277 -0
- package/src/providers/state.provider.ts +357 -0
- package/src/pyre_world.json +35 -230
- package/src/types/action.types.ts +76 -0
- package/src/types/intel.types.ts +22 -0
- package/src/types/mapper.types.ts +84 -0
- package/src/types/registry.types.ts +0 -0
- package/src/types/state.types.ts +144 -0
- package/src/types.ts +329 -333
- package/src/util.ts +148 -0
- package/src/vanity.ts +27 -14
- package/tests/test_e2e.ts +339 -172
- package/src/actions.ts +0 -703
- package/src/intel.ts +0 -521
- package/src/mappers.ts +0 -302
- package/src/registry.ts +0 -317
- package/tests/test_devnet_e2e.ts +0 -401
- package/tests/test_sim.ts +0 -458
package/src/types.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* protocol primitives into faction warfare language.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { Transaction, Keypair, PublicKey } from '@solana/web3.js'
|
|
9
|
+
import type { Transaction, Keypair, PublicKey } from '@solana/web3.js'
|
|
10
10
|
import type {
|
|
11
11
|
TokenSortOption,
|
|
12
12
|
TransactionResult,
|
|
@@ -14,369 +14,357 @@ import type {
|
|
|
14
14
|
SaidVerification,
|
|
15
15
|
ConfirmResult,
|
|
16
16
|
EphemeralAgent,
|
|
17
|
-
} from 'torchsdk'
|
|
17
|
+
} from 'torchsdk'
|
|
18
18
|
|
|
19
|
-
// ─── Status
|
|
19
|
+
// ─── Status Enums ───────────────────────────────────────────
|
|
20
20
|
|
|
21
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';
|
|
22
|
+
export type FactionStatus = 'rising' | 'ready' | 'ascended' | 'razed'
|
|
26
23
|
|
|
27
24
|
/** Governance strategy: scorched_earth (burn tokens) or fortify (return to treasury lock) */
|
|
28
|
-
export type Strategy = '
|
|
25
|
+
export type Strategy = 'smelt' | 'fortify'
|
|
29
26
|
|
|
30
27
|
/** Agent loan health status */
|
|
31
|
-
export type AgentHealth = 'healthy' | 'at_risk' | 'liquidatable' | 'none'
|
|
28
|
+
export type AgentHealth = 'healthy' | 'at_risk' | 'liquidatable' | 'none'
|
|
32
29
|
|
|
33
30
|
// ─── Core Game Types ───────────────────────────────────────────────
|
|
34
31
|
|
|
35
32
|
/** Summary view of a faction (wraps TokenSummary) */
|
|
36
33
|
export interface FactionSummary {
|
|
37
|
-
mint: string
|
|
38
|
-
name: string
|
|
39
|
-
symbol: string
|
|
40
|
-
status: FactionStatus
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
last_activity_at: number;
|
|
34
|
+
mint: string
|
|
35
|
+
name: string
|
|
36
|
+
symbol: string
|
|
37
|
+
status: FactionStatus
|
|
38
|
+
price_sol: number
|
|
39
|
+
market_cap_sol: number
|
|
40
|
+
progress_percent: number
|
|
41
|
+
members: number | null
|
|
42
|
+
created_at: number
|
|
43
|
+
last_activity_at: number
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
/** Detailed view of a faction (wraps TokenDetail) */
|
|
51
47
|
export interface FactionDetail {
|
|
52
|
-
mint: string
|
|
53
|
-
name: string
|
|
54
|
-
symbol: string
|
|
55
|
-
description?: string
|
|
56
|
-
image?: string
|
|
57
|
-
status: FactionStatus
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
warnings?: string[];
|
|
48
|
+
mint: string
|
|
49
|
+
name: string
|
|
50
|
+
symbol: string
|
|
51
|
+
description?: string
|
|
52
|
+
image?: string
|
|
53
|
+
status: FactionStatus
|
|
54
|
+
price_sol: number
|
|
55
|
+
price_usd?: number
|
|
56
|
+
market_cap_sol: number
|
|
57
|
+
market_cap_usd?: number
|
|
58
|
+
progress_percent: number
|
|
59
|
+
sol_raised: number
|
|
60
|
+
sol_target: number
|
|
61
|
+
total_supply: number
|
|
62
|
+
circulating_supply: number
|
|
63
|
+
tokens_in_curve: number
|
|
64
|
+
tokens_in_vote_vault: number
|
|
65
|
+
tokens_burned: number
|
|
66
|
+
war_chest_sol: number
|
|
67
|
+
war_chest_tokens: number
|
|
68
|
+
total_bought_back: number
|
|
69
|
+
buyback_count: number
|
|
70
|
+
votes_scorched_earth: number
|
|
71
|
+
votes_fortify: number
|
|
72
|
+
founder: string
|
|
73
|
+
members: number | null
|
|
74
|
+
rallies: number
|
|
75
|
+
created_at: number
|
|
76
|
+
last_activity_at: number
|
|
77
|
+
twitter?: string
|
|
78
|
+
telegram?: string
|
|
79
|
+
website?: string
|
|
80
|
+
founder_verified?: boolean
|
|
81
|
+
founder_trust_tier?: 'high' | 'medium' | 'low' | null
|
|
82
|
+
founder_said_name?: string
|
|
83
|
+
founder_badge_url?: string
|
|
84
|
+
warnings?: string[]
|
|
90
85
|
}
|
|
91
86
|
|
|
92
87
|
/** Agent stronghold (wraps VaultInfo) */
|
|
93
88
|
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
|
|
89
|
+
address: string
|
|
90
|
+
creator: string
|
|
91
|
+
authority: string
|
|
92
|
+
sol_balance: number
|
|
93
|
+
total_deposited: number
|
|
94
|
+
total_withdrawn: number
|
|
95
|
+
total_spent: number
|
|
96
|
+
total_received: number
|
|
97
|
+
linked_agents: number
|
|
98
|
+
created_at: number
|
|
104
99
|
}
|
|
105
100
|
|
|
106
101
|
/** Agent wallet link (wraps VaultWalletLinkInfo) */
|
|
107
102
|
export interface AgentLink {
|
|
108
|
-
address: string
|
|
109
|
-
stronghold: string
|
|
110
|
-
wallet: string
|
|
111
|
-
linked_at: number
|
|
103
|
+
address: string
|
|
104
|
+
stronghold: string
|
|
105
|
+
wallet: string
|
|
106
|
+
linked_at: number
|
|
112
107
|
}
|
|
113
108
|
|
|
114
109
|
/** Faction communication (wraps TokenMessage) */
|
|
115
110
|
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
|
|
111
|
+
signature: string
|
|
112
|
+
memo: string
|
|
113
|
+
sender: string
|
|
114
|
+
timestamp: number
|
|
115
|
+
sender_verified?: boolean
|
|
116
|
+
sender_trust_tier?: 'high' | 'medium' | 'low' | null
|
|
117
|
+
sender_said_name?: string
|
|
118
|
+
sender_badge_url?: string
|
|
124
119
|
}
|
|
125
120
|
|
|
126
121
|
/** War chest lending info (wraps LendingInfo) */
|
|
127
122
|
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[]
|
|
123
|
+
interest_rate_bps: number
|
|
124
|
+
max_ltv_bps: number
|
|
125
|
+
liquidation_threshold_bps: number
|
|
126
|
+
liquidation_bonus_bps: number
|
|
127
|
+
utilization_cap_bps: number
|
|
128
|
+
borrow_share_multiplier: number
|
|
129
|
+
total_sol_lent: number | null
|
|
130
|
+
active_loans: number | null
|
|
131
|
+
war_chest_sol_available: number
|
|
132
|
+
warnings?: string[]
|
|
138
133
|
}
|
|
139
134
|
|
|
140
135
|
/** War loan position (wraps LoanPositionInfo) */
|
|
141
136
|
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[]
|
|
137
|
+
collateral_amount: number
|
|
138
|
+
borrowed_amount: number
|
|
139
|
+
accrued_interest: number
|
|
140
|
+
total_owed: number
|
|
141
|
+
collateral_value_sol: number | null
|
|
142
|
+
current_ltv_bps: number | null
|
|
143
|
+
health: AgentHealth
|
|
144
|
+
warnings?: string[]
|
|
150
145
|
}
|
|
151
146
|
|
|
152
147
|
/** War loan with borrower key (wraps LoanPositionWithKey) */
|
|
153
148
|
export interface WarLoanWithAgent extends WarLoan {
|
|
154
|
-
borrower: string
|
|
149
|
+
borrower: string
|
|
155
150
|
}
|
|
156
151
|
|
|
157
152
|
/** Faction member (wraps Holder) */
|
|
158
153
|
export interface Member {
|
|
159
|
-
address: string
|
|
160
|
-
balance: number
|
|
161
|
-
percentage: number
|
|
154
|
+
address: string
|
|
155
|
+
balance: number
|
|
156
|
+
percentage: number
|
|
162
157
|
}
|
|
163
158
|
|
|
164
159
|
// ─── List Results ──────────────────────────────────────────────────
|
|
165
160
|
|
|
166
161
|
export interface FactionListResult {
|
|
167
|
-
factions: FactionSummary[]
|
|
168
|
-
total: number
|
|
169
|
-
limit: number
|
|
170
|
-
offset: number
|
|
162
|
+
factions: FactionSummary[]
|
|
163
|
+
total: number
|
|
164
|
+
limit: number
|
|
165
|
+
offset: number
|
|
171
166
|
}
|
|
172
167
|
|
|
173
168
|
export interface MembersResult {
|
|
174
|
-
members: Member[]
|
|
175
|
-
total_members: number
|
|
169
|
+
members: Member[]
|
|
170
|
+
total_members: number
|
|
176
171
|
}
|
|
177
172
|
|
|
178
173
|
export interface CommsResult {
|
|
179
|
-
comms: Comms[]
|
|
180
|
-
total: number
|
|
174
|
+
comms: Comms[]
|
|
175
|
+
total: number
|
|
181
176
|
}
|
|
182
177
|
|
|
183
178
|
export interface AllWarLoansResult {
|
|
184
|
-
positions: WarLoanWithAgent[]
|
|
185
|
-
pool_price_sol: number | null
|
|
179
|
+
positions: WarLoanWithAgent[]
|
|
180
|
+
pool_price_sol: number | null
|
|
186
181
|
}
|
|
187
182
|
|
|
188
183
|
// ─── Action Params ─────────────────────────────────────────────────
|
|
189
184
|
|
|
190
185
|
export interface LaunchFactionParams {
|
|
191
|
-
founder: string
|
|
192
|
-
name: string
|
|
193
|
-
symbol: string
|
|
194
|
-
metadata_uri: string
|
|
195
|
-
sol_target?: number
|
|
196
|
-
community_faction?: boolean
|
|
186
|
+
founder: string
|
|
187
|
+
name: string
|
|
188
|
+
symbol: string
|
|
189
|
+
metadata_uri: string
|
|
190
|
+
sol_target?: number
|
|
191
|
+
community_faction?: boolean
|
|
197
192
|
}
|
|
198
193
|
|
|
199
194
|
export interface JoinFactionParams {
|
|
200
|
-
mint: string
|
|
201
|
-
agent: string
|
|
202
|
-
amount_sol: number
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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;
|
|
195
|
+
mint: string
|
|
196
|
+
agent: string
|
|
197
|
+
amount_sol: number
|
|
198
|
+
stronghold: string
|
|
199
|
+
slippage_bps?: number
|
|
200
|
+
strategy?: Strategy
|
|
201
|
+
message?: string
|
|
202
|
+
ascended?: boolean
|
|
216
203
|
}
|
|
217
204
|
|
|
218
205
|
export interface DefectParams {
|
|
219
|
-
mint: string
|
|
220
|
-
agent: string
|
|
221
|
-
amount_tokens: number
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
206
|
+
mint: string
|
|
207
|
+
agent: string
|
|
208
|
+
amount_tokens: number
|
|
209
|
+
stronghold: string
|
|
210
|
+
slippage_bps?: number
|
|
211
|
+
message?: string
|
|
212
|
+
ascended?: boolean
|
|
225
213
|
}
|
|
226
214
|
|
|
227
215
|
/** "Said in" — micro buy + message (costs 0.001 SOL) */
|
|
228
216
|
export interface MessageFactionParams {
|
|
229
|
-
mint: string
|
|
230
|
-
agent: string
|
|
231
|
-
message: string
|
|
232
|
-
stronghold: string
|
|
233
|
-
ascended?: boolean
|
|
234
|
-
first_buy?: boolean
|
|
217
|
+
mint: string
|
|
218
|
+
agent: string
|
|
219
|
+
message: string
|
|
220
|
+
stronghold: string
|
|
221
|
+
ascended?: boolean
|
|
222
|
+
first_buy?: boolean
|
|
235
223
|
}
|
|
236
224
|
|
|
237
225
|
/** "Argued in" — micro sell + negative message (sells 100 tokens) */
|
|
238
226
|
export interface FudFactionParams {
|
|
239
|
-
mint: string
|
|
240
|
-
agent: string
|
|
241
|
-
message: string
|
|
242
|
-
stronghold: string
|
|
243
|
-
ascended?: boolean
|
|
227
|
+
mint: string
|
|
228
|
+
agent: string
|
|
229
|
+
message: string
|
|
230
|
+
stronghold: string
|
|
231
|
+
ascended?: boolean
|
|
244
232
|
}
|
|
245
233
|
|
|
246
234
|
export interface RallyParams {
|
|
247
|
-
mint: string
|
|
248
|
-
agent: string
|
|
249
|
-
stronghold?: string
|
|
235
|
+
mint: string
|
|
236
|
+
agent: string
|
|
237
|
+
stronghold?: string
|
|
250
238
|
}
|
|
251
239
|
|
|
252
240
|
export interface RequestWarLoanParams {
|
|
253
|
-
mint: string
|
|
254
|
-
borrower: string
|
|
255
|
-
collateral_amount: number
|
|
256
|
-
sol_to_borrow: number
|
|
257
|
-
stronghold
|
|
241
|
+
mint: string
|
|
242
|
+
borrower: string
|
|
243
|
+
collateral_amount: number
|
|
244
|
+
sol_to_borrow: number
|
|
245
|
+
stronghold: string
|
|
258
246
|
}
|
|
259
247
|
|
|
260
248
|
export interface RepayWarLoanParams {
|
|
261
|
-
mint: string
|
|
262
|
-
borrower: string
|
|
263
|
-
sol_amount: number
|
|
264
|
-
stronghold
|
|
249
|
+
mint: string
|
|
250
|
+
borrower: string
|
|
251
|
+
sol_amount: number
|
|
252
|
+
stronghold: string
|
|
265
253
|
}
|
|
266
254
|
|
|
267
255
|
export interface SiegeParams {
|
|
268
|
-
mint: string
|
|
269
|
-
liquidator: string
|
|
270
|
-
borrower: string
|
|
271
|
-
stronghold
|
|
256
|
+
mint: string
|
|
257
|
+
liquidator: string
|
|
258
|
+
borrower: string
|
|
259
|
+
stronghold: string
|
|
272
260
|
}
|
|
273
261
|
|
|
274
262
|
export interface TradeOnDexParams {
|
|
275
|
-
mint: string
|
|
276
|
-
signer: string
|
|
277
|
-
stronghold_creator: string
|
|
278
|
-
amount_in: number
|
|
279
|
-
minimum_amount_out: number
|
|
280
|
-
is_buy: boolean
|
|
263
|
+
mint: string
|
|
264
|
+
signer: string
|
|
265
|
+
stronghold_creator: string
|
|
266
|
+
amount_in: number
|
|
267
|
+
minimum_amount_out: number
|
|
268
|
+
is_buy: boolean
|
|
281
269
|
/** Optional message bundled as SPL Memo instruction (max 500 chars) */
|
|
282
|
-
message?: string
|
|
270
|
+
message?: string
|
|
283
271
|
}
|
|
284
272
|
|
|
285
273
|
export interface ClaimSpoilsParams {
|
|
286
|
-
agent: string
|
|
287
|
-
stronghold?: string
|
|
274
|
+
agent: string
|
|
275
|
+
stronghold?: string
|
|
288
276
|
}
|
|
289
277
|
|
|
290
278
|
export interface CreateStrongholdParams {
|
|
291
|
-
creator: string
|
|
279
|
+
creator: string
|
|
292
280
|
}
|
|
293
281
|
|
|
294
282
|
export interface FundStrongholdParams {
|
|
295
|
-
depositor: string
|
|
296
|
-
stronghold_creator: string
|
|
297
|
-
amount_sol: number
|
|
283
|
+
depositor: string
|
|
284
|
+
stronghold_creator: string
|
|
285
|
+
amount_sol: number
|
|
298
286
|
}
|
|
299
287
|
|
|
300
288
|
export interface WithdrawFromStrongholdParams {
|
|
301
|
-
authority: string
|
|
302
|
-
stronghold_creator: string
|
|
303
|
-
amount_sol: number
|
|
289
|
+
authority: string
|
|
290
|
+
stronghold_creator: string
|
|
291
|
+
amount_sol: number
|
|
304
292
|
}
|
|
305
293
|
|
|
306
294
|
export interface RecruitAgentParams {
|
|
307
|
-
authority: string
|
|
308
|
-
stronghold_creator: string
|
|
309
|
-
wallet_to_link: string
|
|
295
|
+
authority: string
|
|
296
|
+
stronghold_creator: string
|
|
297
|
+
wallet_to_link: string
|
|
310
298
|
}
|
|
311
299
|
|
|
312
300
|
export interface ExileAgentParams {
|
|
313
|
-
authority: string
|
|
314
|
-
stronghold_creator: string
|
|
315
|
-
wallet_to_unlink: string
|
|
301
|
+
authority: string
|
|
302
|
+
stronghold_creator: string
|
|
303
|
+
wallet_to_unlink: string
|
|
316
304
|
}
|
|
317
305
|
|
|
318
306
|
export interface CoupParams {
|
|
319
|
-
authority: string
|
|
320
|
-
stronghold_creator: string
|
|
321
|
-
new_authority: string
|
|
307
|
+
authority: string
|
|
308
|
+
stronghold_creator: string
|
|
309
|
+
new_authority: string
|
|
322
310
|
}
|
|
323
311
|
|
|
324
312
|
export interface WithdrawAssetsParams {
|
|
325
|
-
authority: string
|
|
326
|
-
stronghold_creator: string
|
|
327
|
-
mint: string
|
|
328
|
-
destination: string
|
|
329
|
-
amount: number
|
|
313
|
+
authority: string
|
|
314
|
+
stronghold_creator: string
|
|
315
|
+
mint: string
|
|
316
|
+
destination: string
|
|
317
|
+
amount: number
|
|
330
318
|
}
|
|
331
319
|
|
|
332
320
|
export interface AscendParams {
|
|
333
|
-
mint: string
|
|
334
|
-
payer: string
|
|
321
|
+
mint: string
|
|
322
|
+
payer: string
|
|
335
323
|
}
|
|
336
324
|
|
|
337
325
|
export interface RazeParams {
|
|
338
|
-
payer: string
|
|
339
|
-
mint: string
|
|
326
|
+
payer: string
|
|
327
|
+
mint: string
|
|
340
328
|
}
|
|
341
329
|
|
|
342
330
|
export interface TitheParams {
|
|
343
|
-
mint: string
|
|
344
|
-
payer: string
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
export interface ConvertTitheParams {
|
|
349
|
-
mint: string;
|
|
350
|
-
payer: string;
|
|
351
|
-
minimum_amount_out?: number;
|
|
352
|
-
harvest?: boolean;
|
|
353
|
-
sources?: string[];
|
|
331
|
+
mint: string
|
|
332
|
+
payer: string
|
|
333
|
+
minimum_amount_out?: number
|
|
334
|
+
harvest?: boolean
|
|
335
|
+
sources?: string[]
|
|
354
336
|
}
|
|
355
337
|
|
|
356
338
|
// ─── Action Results ────────────────────────────────────────────────
|
|
357
339
|
|
|
358
340
|
/** Re-export base result types with game names */
|
|
359
|
-
export type {
|
|
341
|
+
export type {
|
|
342
|
+
TransactionResult,
|
|
343
|
+
CreateTokenResult,
|
|
344
|
+
EphemeralAgent,
|
|
345
|
+
SaidVerification,
|
|
346
|
+
ConfirmResult,
|
|
347
|
+
}
|
|
360
348
|
|
|
361
349
|
export interface JoinFactionResult extends TransactionResult {
|
|
362
|
-
migrationTransaction?: Transaction
|
|
350
|
+
migrationTransaction?: Transaction
|
|
363
351
|
}
|
|
364
352
|
|
|
365
353
|
export interface LaunchFactionResult extends TransactionResult {
|
|
366
|
-
mint: PublicKey
|
|
367
|
-
mintKeypair: Keypair
|
|
354
|
+
mint: PublicKey
|
|
355
|
+
mintKeypair: Keypair
|
|
368
356
|
}
|
|
369
357
|
|
|
370
358
|
// ─── List/Filter Params ────────────────────────────────────────────
|
|
371
359
|
|
|
372
|
-
export type FactionSortOption = TokenSortOption
|
|
373
|
-
export type FactionStatusFilter = 'rising' | 'ready' | 'ascended' | 'razed' | 'all'
|
|
360
|
+
export type FactionSortOption = TokenSortOption
|
|
361
|
+
export type FactionStatusFilter = 'rising' | 'ready' | 'ascended' | 'razed' | 'all'
|
|
374
362
|
|
|
375
363
|
export interface FactionListParams {
|
|
376
|
-
limit?: number
|
|
377
|
-
offset?: number
|
|
378
|
-
status?: FactionStatusFilter
|
|
379
|
-
sort?: FactionSortOption
|
|
364
|
+
limit?: number
|
|
365
|
+
offset?: number
|
|
366
|
+
status?: FactionStatusFilter
|
|
367
|
+
sort?: FactionSortOption
|
|
380
368
|
}
|
|
381
369
|
|
|
382
370
|
// ─── War Loan Quote ─────────────────────────────────────────────
|
|
@@ -384,177 +372,185 @@ export interface FactionListParams {
|
|
|
384
372
|
/** Result of computing max borrowable SOL for a given collateral amount */
|
|
385
373
|
export interface WarLoanQuote {
|
|
386
374
|
/** Max SOL borrowable (lamports) — minimum of LTV cap, pool available, per-user cap */
|
|
387
|
-
max_borrow_sol: number
|
|
375
|
+
max_borrow_sol: number
|
|
388
376
|
/** Collateral value in SOL (lamports) */
|
|
389
|
-
collateral_value_sol: number
|
|
377
|
+
collateral_value_sol: number
|
|
390
378
|
/** LTV-limited max borrow (lamports) */
|
|
391
|
-
ltv_max_sol: number
|
|
379
|
+
ltv_max_sol: number
|
|
392
380
|
/** Pool available SOL (lamports) */
|
|
393
|
-
pool_available_sol: number
|
|
381
|
+
pool_available_sol: number
|
|
394
382
|
/** Per-user cap SOL (lamports) — based on share of supply * borrow_share_multiplier */
|
|
395
|
-
per_user_cap_sol: number
|
|
383
|
+
per_user_cap_sol: number
|
|
396
384
|
/** Current interest rate in bps per epoch */
|
|
397
|
-
interest_rate_bps: number
|
|
385
|
+
interest_rate_bps: number
|
|
398
386
|
/** Liquidation threshold in bps */
|
|
399
|
-
liquidation_threshold_bps: number
|
|
387
|
+
liquidation_threshold_bps: number
|
|
400
388
|
}
|
|
401
389
|
|
|
402
390
|
// ─── Intel Types ───────────────────────────────────────────────────
|
|
403
391
|
|
|
404
392
|
export interface FactionPower {
|
|
405
|
-
mint: string
|
|
406
|
-
name: string
|
|
407
|
-
symbol: string
|
|
408
|
-
score: number
|
|
409
|
-
market_cap_sol: number
|
|
410
|
-
members: number
|
|
411
|
-
war_chest_sol: number
|
|
412
|
-
rallies: number
|
|
413
|
-
progress_percent: number
|
|
414
|
-
status: FactionStatus
|
|
393
|
+
mint: string
|
|
394
|
+
name: string
|
|
395
|
+
symbol: string
|
|
396
|
+
score: number
|
|
397
|
+
market_cap_sol: number
|
|
398
|
+
members: number
|
|
399
|
+
war_chest_sol: number
|
|
400
|
+
rallies: number
|
|
401
|
+
progress_percent: number
|
|
402
|
+
status: FactionStatus
|
|
415
403
|
}
|
|
416
404
|
|
|
417
405
|
export interface AllianceCluster {
|
|
418
|
-
factions: string[]
|
|
419
|
-
shared_members: number
|
|
420
|
-
overlap_percent: number
|
|
406
|
+
factions: string[]
|
|
407
|
+
shared_members: number
|
|
408
|
+
overlap_percent: number
|
|
421
409
|
}
|
|
422
410
|
|
|
423
411
|
export interface RivalFaction {
|
|
424
|
-
mint: string
|
|
425
|
-
name: string
|
|
426
|
-
symbol: string
|
|
427
|
-
defections_in: number
|
|
428
|
-
defections_out: number
|
|
412
|
+
mint: string
|
|
413
|
+
name: string
|
|
414
|
+
symbol: string
|
|
415
|
+
defections_in: number
|
|
416
|
+
defections_out: number
|
|
429
417
|
}
|
|
430
418
|
|
|
431
419
|
export interface AgentProfile {
|
|
432
|
-
wallet: string
|
|
433
|
-
stronghold: Stronghold | null
|
|
434
|
-
factions_joined: AgentFactionPosition[]
|
|
435
|
-
factions_founded: string[]
|
|
436
|
-
|
|
437
|
-
total_value_sol: number;
|
|
420
|
+
wallet: string
|
|
421
|
+
stronghold: Stronghold | null
|
|
422
|
+
factions_joined: AgentFactionPosition[]
|
|
423
|
+
factions_founded: string[]
|
|
424
|
+
total_value_sol: number
|
|
438
425
|
}
|
|
439
426
|
|
|
440
427
|
export interface AgentFactionPosition {
|
|
441
|
-
mint: string
|
|
442
|
-
name: string
|
|
443
|
-
symbol: string
|
|
444
|
-
balance: number
|
|
445
|
-
percentage: number
|
|
446
|
-
value_sol: number
|
|
428
|
+
mint: string
|
|
429
|
+
name: string
|
|
430
|
+
symbol: string
|
|
431
|
+
balance: number
|
|
432
|
+
percentage: number
|
|
433
|
+
value_sol: number
|
|
447
434
|
}
|
|
448
435
|
|
|
449
436
|
/** Action types for world events and stage feed */
|
|
450
437
|
export type WorldEventType =
|
|
451
|
-
| 'launch'
|
|
452
|
-
| '
|
|
453
|
-
| '
|
|
438
|
+
| 'launch'
|
|
439
|
+
| 'join'
|
|
440
|
+
| 'reinforce'
|
|
441
|
+
| 'defect'
|
|
442
|
+
| 'rally'
|
|
443
|
+
| 'ascend'
|
|
444
|
+
| 'raze'
|
|
445
|
+
| 'messaged'
|
|
446
|
+
| 'siege'
|
|
447
|
+
| 'tithe'
|
|
448
|
+
| 'war_loan'
|
|
449
|
+
| 'repay_loan'
|
|
454
450
|
|
|
455
451
|
export interface WorldEvent {
|
|
456
|
-
type: WorldEventType
|
|
457
|
-
faction_mint: string
|
|
458
|
-
faction_name: string
|
|
459
|
-
agent?: string
|
|
460
|
-
amount_sol?: number
|
|
461
|
-
timestamp: number
|
|
462
|
-
signature?: string
|
|
463
|
-
message?: string
|
|
452
|
+
type: WorldEventType
|
|
453
|
+
faction_mint: string
|
|
454
|
+
faction_name: string
|
|
455
|
+
agent?: string
|
|
456
|
+
amount_sol?: number
|
|
457
|
+
timestamp: number
|
|
458
|
+
signature?: string
|
|
459
|
+
message?: string
|
|
464
460
|
}
|
|
465
461
|
|
|
466
462
|
export interface WorldStats {
|
|
467
|
-
total_factions: number
|
|
468
|
-
rising_factions: number
|
|
469
|
-
ascended_factions: number
|
|
470
|
-
total_sol_locked: number
|
|
471
|
-
most_powerful: FactionPower | null
|
|
463
|
+
total_factions: number
|
|
464
|
+
rising_factions: number
|
|
465
|
+
ascended_factions: number
|
|
466
|
+
total_sol_locked: number
|
|
467
|
+
most_powerful: FactionPower | null
|
|
472
468
|
}
|
|
473
469
|
|
|
474
470
|
// ─── Registry Types (pyre_world on-chain agent identity) ──────────
|
|
475
471
|
|
|
476
472
|
/** On-chain agent profile from pyre_world registry */
|
|
477
473
|
export interface RegistryProfile {
|
|
478
|
-
address: string
|
|
479
|
-
creator: string
|
|
480
|
-
authority: string
|
|
481
|
-
linked_wallet: string
|
|
482
|
-
personality_summary: string
|
|
483
|
-
last_checkpoint: number
|
|
484
|
-
joins: number
|
|
485
|
-
defects: number
|
|
486
|
-
rallies: number
|
|
487
|
-
launches: number
|
|
488
|
-
messages: number
|
|
489
|
-
fuds: number
|
|
490
|
-
infiltrates: number
|
|
491
|
-
reinforces: number
|
|
492
|
-
war_loans: number
|
|
493
|
-
repay_loans: number
|
|
494
|
-
sieges: number
|
|
495
|
-
ascends: number
|
|
496
|
-
razes: number
|
|
497
|
-
tithes: number
|
|
498
|
-
created_at: number
|
|
499
|
-
bump: number
|
|
500
|
-
total_sol_spent: number
|
|
501
|
-
total_sol_received: number
|
|
474
|
+
address: string
|
|
475
|
+
creator: string
|
|
476
|
+
authority: string
|
|
477
|
+
linked_wallet: string
|
|
478
|
+
personality_summary: string
|
|
479
|
+
last_checkpoint: number
|
|
480
|
+
joins: number
|
|
481
|
+
defects: number
|
|
482
|
+
rallies: number
|
|
483
|
+
launches: number
|
|
484
|
+
messages: number
|
|
485
|
+
fuds: number
|
|
486
|
+
infiltrates: number
|
|
487
|
+
reinforces: number
|
|
488
|
+
war_loans: number
|
|
489
|
+
repay_loans: number
|
|
490
|
+
sieges: number
|
|
491
|
+
ascends: number
|
|
492
|
+
razes: number
|
|
493
|
+
tithes: number
|
|
494
|
+
created_at: number
|
|
495
|
+
bump: number
|
|
496
|
+
total_sol_spent: number
|
|
497
|
+
total_sol_received: number
|
|
502
498
|
}
|
|
503
499
|
|
|
504
500
|
/** On-chain wallet link from pyre_world registry */
|
|
505
501
|
export interface RegistryWalletLink {
|
|
506
|
-
address: string
|
|
507
|
-
profile: string
|
|
508
|
-
wallet: string
|
|
509
|
-
linked_at: number
|
|
510
|
-
bump: number
|
|
502
|
+
address: string
|
|
503
|
+
profile: string
|
|
504
|
+
wallet: string
|
|
505
|
+
linked_at: number
|
|
506
|
+
bump: number
|
|
511
507
|
}
|
|
512
508
|
|
|
513
509
|
/** Params for checkpointing agent state on-chain */
|
|
514
510
|
export interface CheckpointParams {
|
|
515
|
-
signer: string
|
|
516
|
-
creator: string
|
|
517
|
-
joins: number
|
|
518
|
-
defects: number
|
|
519
|
-
rallies: number
|
|
520
|
-
launches: number
|
|
521
|
-
messages: number
|
|
522
|
-
fuds: number
|
|
523
|
-
infiltrates: number
|
|
524
|
-
reinforces: number
|
|
525
|
-
war_loans: number
|
|
526
|
-
repay_loans: number
|
|
527
|
-
sieges: number
|
|
528
|
-
ascends: number
|
|
529
|
-
razes: number
|
|
530
|
-
tithes: number
|
|
531
|
-
personality_summary: string
|
|
532
|
-
total_sol_spent: number
|
|
533
|
-
total_sol_received: number
|
|
511
|
+
signer: string
|
|
512
|
+
creator: string
|
|
513
|
+
joins: number
|
|
514
|
+
defects: number
|
|
515
|
+
rallies: number
|
|
516
|
+
launches: number
|
|
517
|
+
messages: number
|
|
518
|
+
fuds: number
|
|
519
|
+
infiltrates: number
|
|
520
|
+
reinforces: number
|
|
521
|
+
war_loans: number
|
|
522
|
+
repay_loans: number
|
|
523
|
+
sieges: number
|
|
524
|
+
ascends: number
|
|
525
|
+
razes: number
|
|
526
|
+
tithes: number
|
|
527
|
+
personality_summary: string
|
|
528
|
+
total_sol_spent: number
|
|
529
|
+
total_sol_received: number
|
|
534
530
|
}
|
|
535
531
|
|
|
536
532
|
/** Params for registering a new agent */
|
|
537
533
|
export interface RegisterAgentParams {
|
|
538
|
-
creator: string
|
|
534
|
+
creator: string
|
|
539
535
|
}
|
|
540
536
|
|
|
541
537
|
/** Params for linking a wallet to an agent profile */
|
|
542
538
|
export interface LinkAgentWalletParams {
|
|
543
|
-
authority: string
|
|
544
|
-
creator: string
|
|
545
|
-
wallet_to_link: string
|
|
539
|
+
authority: string
|
|
540
|
+
creator: string
|
|
541
|
+
wallet_to_link: string
|
|
546
542
|
}
|
|
547
543
|
|
|
548
544
|
/** Params for unlinking a wallet from an agent profile */
|
|
549
545
|
export interface UnlinkAgentWalletParams {
|
|
550
|
-
authority: string
|
|
551
|
-
creator: string
|
|
552
|
-
wallet_to_unlink: string
|
|
546
|
+
authority: string
|
|
547
|
+
creator: string
|
|
548
|
+
wallet_to_unlink: string
|
|
553
549
|
}
|
|
554
550
|
|
|
555
551
|
/** Params for transferring agent profile authority */
|
|
556
552
|
export interface TransferAgentAuthorityParams {
|
|
557
|
-
authority: string
|
|
558
|
-
creator: string
|
|
559
|
-
new_authority: string
|
|
553
|
+
authority: string
|
|
554
|
+
creator: string
|
|
555
|
+
new_authority: string
|
|
560
556
|
}
|