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/pyre_world.json
CHANGED
|
@@ -13,16 +13,7 @@
|
|
|
13
13
|
"Update action counters and personality summary.",
|
|
14
14
|
"Only the linked wallet can call this."
|
|
15
15
|
],
|
|
16
|
-
"discriminator": [
|
|
17
|
-
213,
|
|
18
|
-
200,
|
|
19
|
-
19,
|
|
20
|
-
204,
|
|
21
|
-
240,
|
|
22
|
-
143,
|
|
23
|
-
184,
|
|
24
|
-
252
|
|
25
|
-
],
|
|
16
|
+
"discriminator": [213, 200, 19, 204, 240, 143, 184, 252],
|
|
26
17
|
"accounts": [
|
|
27
18
|
{
|
|
28
19
|
"name": "signer",
|
|
@@ -59,24 +50,13 @@
|
|
|
59
50
|
"Link a new wallet to the profile. Authority only.",
|
|
60
51
|
"Must unlink existing wallet first."
|
|
61
52
|
],
|
|
62
|
-
"discriminator": [
|
|
63
|
-
86,
|
|
64
|
-
92,
|
|
65
|
-
31,
|
|
66
|
-
146,
|
|
67
|
-
228,
|
|
68
|
-
51,
|
|
69
|
-
209,
|
|
70
|
-
230
|
|
71
|
-
],
|
|
53
|
+
"discriminator": [86, 92, 31, 146, 228, 51, 209, 230],
|
|
72
54
|
"accounts": [
|
|
73
55
|
{
|
|
74
56
|
"name": "authority",
|
|
75
57
|
"writable": true,
|
|
76
58
|
"signer": true,
|
|
77
|
-
"relations": [
|
|
78
|
-
"profile"
|
|
79
|
-
]
|
|
59
|
+
"relations": ["profile"]
|
|
80
60
|
},
|
|
81
61
|
{
|
|
82
62
|
"name": "profile",
|
|
@@ -85,18 +65,7 @@
|
|
|
85
65
|
"seeds": [
|
|
86
66
|
{
|
|
87
67
|
"kind": "const",
|
|
88
|
-
"value": [
|
|
89
|
-
112,
|
|
90
|
-
121,
|
|
91
|
-
114,
|
|
92
|
-
101,
|
|
93
|
-
95,
|
|
94
|
-
97,
|
|
95
|
-
103,
|
|
96
|
-
101,
|
|
97
|
-
110,
|
|
98
|
-
116
|
|
99
|
-
]
|
|
68
|
+
"value": [112, 121, 114, 101, 95, 97, 103, 101, 110, 116]
|
|
100
69
|
},
|
|
101
70
|
{
|
|
102
71
|
"kind": "account",
|
|
@@ -117,23 +86,7 @@
|
|
|
117
86
|
{
|
|
118
87
|
"kind": "const",
|
|
119
88
|
"value": [
|
|
120
|
-
112,
|
|
121
|
-
121,
|
|
122
|
-
114,
|
|
123
|
-
101,
|
|
124
|
-
95,
|
|
125
|
-
97,
|
|
126
|
-
103,
|
|
127
|
-
101,
|
|
128
|
-
110,
|
|
129
|
-
116,
|
|
130
|
-
95,
|
|
131
|
-
119,
|
|
132
|
-
97,
|
|
133
|
-
108,
|
|
134
|
-
108,
|
|
135
|
-
101,
|
|
136
|
-
116
|
|
89
|
+
112, 121, 114, 101, 95, 97, 103, 101, 110, 116, 95, 119, 97, 108, 108, 101, 116
|
|
137
90
|
]
|
|
138
91
|
},
|
|
139
92
|
{
|
|
@@ -152,19 +105,8 @@
|
|
|
152
105
|
},
|
|
153
106
|
{
|
|
154
107
|
"name": "register",
|
|
155
|
-
"docs": [
|
|
156
|
-
|
|
157
|
-
],
|
|
158
|
-
"discriminator": [
|
|
159
|
-
211,
|
|
160
|
-
124,
|
|
161
|
-
67,
|
|
162
|
-
15,
|
|
163
|
-
211,
|
|
164
|
-
194,
|
|
165
|
-
178,
|
|
166
|
-
240
|
|
167
|
-
],
|
|
108
|
+
"docs": ["Register a new agent profile and auto-link the creator's wallet."],
|
|
109
|
+
"discriminator": [211, 124, 67, 15, 211, 194, 178, 240],
|
|
168
110
|
"accounts": [
|
|
169
111
|
{
|
|
170
112
|
"name": "creator",
|
|
@@ -178,18 +120,7 @@
|
|
|
178
120
|
"seeds": [
|
|
179
121
|
{
|
|
180
122
|
"kind": "const",
|
|
181
|
-
"value": [
|
|
182
|
-
112,
|
|
183
|
-
121,
|
|
184
|
-
114,
|
|
185
|
-
101,
|
|
186
|
-
95,
|
|
187
|
-
97,
|
|
188
|
-
103,
|
|
189
|
-
101,
|
|
190
|
-
110,
|
|
191
|
-
116
|
|
192
|
-
]
|
|
123
|
+
"value": [112, 121, 114, 101, 95, 97, 103, 101, 110, 116]
|
|
193
124
|
},
|
|
194
125
|
{
|
|
195
126
|
"kind": "account",
|
|
@@ -200,32 +131,14 @@
|
|
|
200
131
|
},
|
|
201
132
|
{
|
|
202
133
|
"name": "wallet_link",
|
|
203
|
-
"docs": [
|
|
204
|
-
"Auto-created wallet link for the creator"
|
|
205
|
-
],
|
|
134
|
+
"docs": ["Auto-created wallet link for the creator"],
|
|
206
135
|
"writable": true,
|
|
207
136
|
"pda": {
|
|
208
137
|
"seeds": [
|
|
209
138
|
{
|
|
210
139
|
"kind": "const",
|
|
211
140
|
"value": [
|
|
212
|
-
112,
|
|
213
|
-
121,
|
|
214
|
-
114,
|
|
215
|
-
101,
|
|
216
|
-
95,
|
|
217
|
-
97,
|
|
218
|
-
103,
|
|
219
|
-
101,
|
|
220
|
-
110,
|
|
221
|
-
116,
|
|
222
|
-
95,
|
|
223
|
-
119,
|
|
224
|
-
97,
|
|
225
|
-
108,
|
|
226
|
-
108,
|
|
227
|
-
101,
|
|
228
|
-
116
|
|
141
|
+
112, 121, 114, 101, 95, 97, 103, 101, 110, 116, 95, 119, 97, 108, 108, 101, 116
|
|
229
142
|
]
|
|
230
143
|
},
|
|
231
144
|
{
|
|
@@ -244,26 +157,13 @@
|
|
|
244
157
|
},
|
|
245
158
|
{
|
|
246
159
|
"name": "transfer_authority",
|
|
247
|
-
"docs": [
|
|
248
|
-
|
|
249
|
-
],
|
|
250
|
-
"discriminator": [
|
|
251
|
-
48,
|
|
252
|
-
169,
|
|
253
|
-
76,
|
|
254
|
-
72,
|
|
255
|
-
229,
|
|
256
|
-
180,
|
|
257
|
-
55,
|
|
258
|
-
161
|
|
259
|
-
],
|
|
160
|
+
"docs": ["Transfer profile authority to a new wallet."],
|
|
161
|
+
"discriminator": [48, 169, 76, 72, 229, 180, 55, 161],
|
|
260
162
|
"accounts": [
|
|
261
163
|
{
|
|
262
164
|
"name": "authority",
|
|
263
165
|
"signer": true,
|
|
264
|
-
"relations": [
|
|
265
|
-
"profile"
|
|
266
|
-
]
|
|
166
|
+
"relations": ["profile"]
|
|
267
167
|
},
|
|
268
168
|
{
|
|
269
169
|
"name": "profile",
|
|
@@ -272,18 +172,7 @@
|
|
|
272
172
|
"seeds": [
|
|
273
173
|
{
|
|
274
174
|
"kind": "const",
|
|
275
|
-
"value": [
|
|
276
|
-
112,
|
|
277
|
-
121,
|
|
278
|
-
114,
|
|
279
|
-
101,
|
|
280
|
-
95,
|
|
281
|
-
97,
|
|
282
|
-
103,
|
|
283
|
-
101,
|
|
284
|
-
110,
|
|
285
|
-
116
|
|
286
|
-
]
|
|
175
|
+
"value": [112, 121, 114, 101, 95, 97, 103, 101, 110, 116]
|
|
287
176
|
},
|
|
288
177
|
{
|
|
289
178
|
"kind": "account",
|
|
@@ -301,27 +190,14 @@
|
|
|
301
190
|
},
|
|
302
191
|
{
|
|
303
192
|
"name": "unlink_wallet",
|
|
304
|
-
"docs": [
|
|
305
|
-
|
|
306
|
-
],
|
|
307
|
-
"discriminator": [
|
|
308
|
-
220,
|
|
309
|
-
121,
|
|
310
|
-
97,
|
|
311
|
-
13,
|
|
312
|
-
193,
|
|
313
|
-
137,
|
|
314
|
-
209,
|
|
315
|
-
159
|
|
316
|
-
],
|
|
193
|
+
"docs": ["Unlink the current wallet. Authority only."],
|
|
194
|
+
"discriminator": [220, 121, 97, 13, 193, 137, 209, 159],
|
|
317
195
|
"accounts": [
|
|
318
196
|
{
|
|
319
197
|
"name": "authority",
|
|
320
198
|
"writable": true,
|
|
321
199
|
"signer": true,
|
|
322
|
-
"relations": [
|
|
323
|
-
"profile"
|
|
324
|
-
]
|
|
200
|
+
"relations": ["profile"]
|
|
325
201
|
},
|
|
326
202
|
{
|
|
327
203
|
"name": "profile",
|
|
@@ -330,18 +206,7 @@
|
|
|
330
206
|
"seeds": [
|
|
331
207
|
{
|
|
332
208
|
"kind": "const",
|
|
333
|
-
"value": [
|
|
334
|
-
112,
|
|
335
|
-
121,
|
|
336
|
-
114,
|
|
337
|
-
101,
|
|
338
|
-
95,
|
|
339
|
-
97,
|
|
340
|
-
103,
|
|
341
|
-
101,
|
|
342
|
-
110,
|
|
343
|
-
116
|
|
344
|
-
]
|
|
209
|
+
"value": [112, 121, 114, 101, 95, 97, 103, 101, 110, 116]
|
|
345
210
|
},
|
|
346
211
|
{
|
|
347
212
|
"kind": "account",
|
|
@@ -362,23 +227,7 @@
|
|
|
362
227
|
{
|
|
363
228
|
"kind": "const",
|
|
364
229
|
"value": [
|
|
365
|
-
112,
|
|
366
|
-
121,
|
|
367
|
-
114,
|
|
368
|
-
101,
|
|
369
|
-
95,
|
|
370
|
-
97,
|
|
371
|
-
103,
|
|
372
|
-
101,
|
|
373
|
-
110,
|
|
374
|
-
116,
|
|
375
|
-
95,
|
|
376
|
-
119,
|
|
377
|
-
97,
|
|
378
|
-
108,
|
|
379
|
-
108,
|
|
380
|
-
101,
|
|
381
|
-
116
|
|
230
|
+
112, 121, 114, 101, 95, 97, 103, 101, 110, 116, 95, 119, 97, 108, 108, 101, 116
|
|
382
231
|
]
|
|
383
232
|
},
|
|
384
233
|
{
|
|
@@ -399,29 +248,11 @@
|
|
|
399
248
|
"accounts": [
|
|
400
249
|
{
|
|
401
250
|
"name": "AgentProfile",
|
|
402
|
-
"discriminator": [
|
|
403
|
-
60,
|
|
404
|
-
227,
|
|
405
|
-
42,
|
|
406
|
-
24,
|
|
407
|
-
0,
|
|
408
|
-
87,
|
|
409
|
-
86,
|
|
410
|
-
205
|
|
411
|
-
]
|
|
251
|
+
"discriminator": [60, 227, 42, 24, 0, 87, 86, 205]
|
|
412
252
|
},
|
|
413
253
|
{
|
|
414
254
|
"name": "AgentWalletLink",
|
|
415
|
-
"discriminator": [
|
|
416
|
-
253,
|
|
417
|
-
251,
|
|
418
|
-
63,
|
|
419
|
-
168,
|
|
420
|
-
140,
|
|
421
|
-
233,
|
|
422
|
-
129,
|
|
423
|
-
156
|
|
424
|
-
]
|
|
255
|
+
"discriminator": [253, 251, 63, 168, 140, 233, 129, 156]
|
|
425
256
|
}
|
|
426
257
|
],
|
|
427
258
|
"errors": [
|
|
@@ -467,37 +298,27 @@
|
|
|
467
298
|
"fields": [
|
|
468
299
|
{
|
|
469
300
|
"name": "creator",
|
|
470
|
-
"docs": [
|
|
471
|
-
"Immutable creator wallet — PDA seed (never changes)"
|
|
472
|
-
],
|
|
301
|
+
"docs": ["Immutable creator wallet — PDA seed (never changes)"],
|
|
473
302
|
"type": "pubkey"
|
|
474
303
|
},
|
|
475
304
|
{
|
|
476
305
|
"name": "authority",
|
|
477
|
-
"docs": [
|
|
478
|
-
"Current authority — controls link/unlink/transfer (transferable)"
|
|
479
|
-
],
|
|
306
|
+
"docs": ["Current authority — controls link/unlink/transfer (transferable)"],
|
|
480
307
|
"type": "pubkey"
|
|
481
308
|
},
|
|
482
309
|
{
|
|
483
310
|
"name": "linked_wallet",
|
|
484
|
-
"docs": [
|
|
485
|
-
"Current active wallet that can write checkpoints"
|
|
486
|
-
],
|
|
311
|
+
"docs": ["Current active wallet that can write checkpoints"],
|
|
487
312
|
"type": "pubkey"
|
|
488
313
|
},
|
|
489
314
|
{
|
|
490
315
|
"name": "personality_summary",
|
|
491
|
-
"docs": [
|
|
492
|
-
"LLM-compressed personality paragraph (max 256 chars)"
|
|
493
|
-
],
|
|
316
|
+
"docs": ["LLM-compressed personality paragraph (max 256 chars)"],
|
|
494
317
|
"type": "string"
|
|
495
318
|
},
|
|
496
319
|
{
|
|
497
320
|
"name": "last_checkpoint",
|
|
498
|
-
"docs": [
|
|
499
|
-
"Unix timestamp of last checkpoint"
|
|
500
|
-
],
|
|
321
|
+
"docs": ["Unix timestamp of last checkpoint"],
|
|
501
322
|
"type": "i64"
|
|
502
323
|
},
|
|
503
324
|
{
|
|
@@ -558,30 +379,22 @@
|
|
|
558
379
|
},
|
|
559
380
|
{
|
|
560
381
|
"name": "created_at",
|
|
561
|
-
"docs": [
|
|
562
|
-
"Registration timestamp"
|
|
563
|
-
],
|
|
382
|
+
"docs": ["Registration timestamp"],
|
|
564
383
|
"type": "i64"
|
|
565
384
|
},
|
|
566
385
|
{
|
|
567
386
|
"name": "bump",
|
|
568
|
-
"docs": [
|
|
569
|
-
"PDA bump"
|
|
570
|
-
],
|
|
387
|
+
"docs": ["PDA bump"],
|
|
571
388
|
"type": "u8"
|
|
572
389
|
},
|
|
573
390
|
{
|
|
574
391
|
"name": "total_sol_spent",
|
|
575
|
-
"docs": [
|
|
576
|
-
"Cumulative SOL spent on joins/buys/infiltrates (lamports)"
|
|
577
|
-
],
|
|
392
|
+
"docs": ["Cumulative SOL spent on joins/buys/infiltrates (lamports)"],
|
|
578
393
|
"type": "u64"
|
|
579
394
|
},
|
|
580
395
|
{
|
|
581
396
|
"name": "total_sol_received",
|
|
582
|
-
"docs": [
|
|
583
|
-
"Cumulative SOL received from defects/sells (lamports)"
|
|
584
|
-
],
|
|
397
|
+
"docs": ["Cumulative SOL received from defects/sells (lamports)"],
|
|
585
398
|
"type": "u64"
|
|
586
399
|
}
|
|
587
400
|
]
|
|
@@ -600,30 +413,22 @@
|
|
|
600
413
|
"fields": [
|
|
601
414
|
{
|
|
602
415
|
"name": "profile",
|
|
603
|
-
"docs": [
|
|
604
|
-
"The AgentProfile this wallet belongs to"
|
|
605
|
-
],
|
|
416
|
+
"docs": ["The AgentProfile this wallet belongs to"],
|
|
606
417
|
"type": "pubkey"
|
|
607
418
|
},
|
|
608
419
|
{
|
|
609
420
|
"name": "wallet",
|
|
610
|
-
"docs": [
|
|
611
|
-
"The linked wallet"
|
|
612
|
-
],
|
|
421
|
+
"docs": ["The linked wallet"],
|
|
613
422
|
"type": "pubkey"
|
|
614
423
|
},
|
|
615
424
|
{
|
|
616
425
|
"name": "linked_at",
|
|
617
|
-
"docs": [
|
|
618
|
-
"When this link was created"
|
|
619
|
-
],
|
|
426
|
+
"docs": ["When this link was created"],
|
|
620
427
|
"type": "i64"
|
|
621
428
|
},
|
|
622
429
|
{
|
|
623
430
|
"name": "bump",
|
|
624
|
-
"docs": [
|
|
625
|
-
"PDA bump"
|
|
626
|
-
],
|
|
431
|
+
"docs": ["PDA bump"],
|
|
627
432
|
"type": "u8"
|
|
628
433
|
}
|
|
629
434
|
]
|
|
@@ -706,4 +511,4 @@
|
|
|
706
511
|
}
|
|
707
512
|
}
|
|
708
513
|
]
|
|
709
|
-
}
|
|
514
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { BuyQuoteResult, SellQuoteResult, TransactionResult } from 'torchsdk'
|
|
2
|
+
import {
|
|
3
|
+
AgentLink,
|
|
4
|
+
AllWarLoansResult,
|
|
5
|
+
AscendParams,
|
|
6
|
+
ClaimSpoilsParams,
|
|
7
|
+
CommsResult,
|
|
8
|
+
CoupParams,
|
|
9
|
+
CreateStrongholdParams,
|
|
10
|
+
DefectParams,
|
|
11
|
+
ExileAgentParams,
|
|
12
|
+
FactionDetail,
|
|
13
|
+
FactionListParams,
|
|
14
|
+
FactionListResult,
|
|
15
|
+
FactionStatus,
|
|
16
|
+
FudFactionParams,
|
|
17
|
+
FundStrongholdParams,
|
|
18
|
+
JoinFactionParams,
|
|
19
|
+
JoinFactionResult,
|
|
20
|
+
LaunchFactionParams,
|
|
21
|
+
LaunchFactionResult,
|
|
22
|
+
MembersResult,
|
|
23
|
+
MessageFactionParams,
|
|
24
|
+
RallyParams,
|
|
25
|
+
RazeParams,
|
|
26
|
+
RecruitAgentParams,
|
|
27
|
+
RepayWarLoanParams,
|
|
28
|
+
RequestWarLoanParams,
|
|
29
|
+
SiegeParams,
|
|
30
|
+
Stronghold,
|
|
31
|
+
TitheParams,
|
|
32
|
+
WarChest,
|
|
33
|
+
WarLoan,
|
|
34
|
+
WarLoanQuote,
|
|
35
|
+
WithdrawAssetsParams,
|
|
36
|
+
WithdrawFromStrongholdParams,
|
|
37
|
+
} from '../types'
|
|
38
|
+
|
|
39
|
+
export interface Action {
|
|
40
|
+
createStronghold(params: CreateStrongholdParams): Promise<TransactionResult>
|
|
41
|
+
coup(params: CoupParams): Promise<TransactionResult>
|
|
42
|
+
exileAgent(params: ExileAgentParams): Promise<TransactionResult>
|
|
43
|
+
fundStronghold(params: FundStrongholdParams): Promise<TransactionResult>
|
|
44
|
+
recruitAgent(params: RecruitAgentParams): Promise<TransactionResult>
|
|
45
|
+
withdrawAssets(params: WithdrawAssetsParams): Promise<TransactionResult>
|
|
46
|
+
withdrawFromStronghold(params: WithdrawFromStrongholdParams): Promise<TransactionResult>
|
|
47
|
+
|
|
48
|
+
getAgentLink(wallet: string): Promise<AgentLink | undefined>
|
|
49
|
+
getComms(mint: string, params: { limit?: number; status?: FactionStatus }): Promise<CommsResult>
|
|
50
|
+
getDefectQuote(mint: string, amountTokens: number): Promise<SellQuoteResult>
|
|
51
|
+
getJoinQuote(mint: string, amountSolLamports: number): Promise<BuyQuoteResult>
|
|
52
|
+
getFaction(mint: string): Promise<FactionDetail>
|
|
53
|
+
getFactions(params?: FactionListParams): Promise<FactionListResult>
|
|
54
|
+
getLinkedAgents(vaultAddress: string): Promise<AgentLink[]>
|
|
55
|
+
getMembers(mint: string, limit?: number): Promise<MembersResult>
|
|
56
|
+
getStronghold(creator: string): Promise<Stronghold | undefined>
|
|
57
|
+
getStrongholdForAgent(wallet: string): Promise<Stronghold | undefined>
|
|
58
|
+
getWarChest(mint: string): Promise<WarChest>
|
|
59
|
+
getWarLoan(mint: string, wallet: string): Promise<WarLoan>
|
|
60
|
+
getWarLoanQuote(mint: string, collateralAmount: number): Promise<WarLoanQuote>
|
|
61
|
+
getWarLoansForFaction(mint: string): Promise<AllWarLoansResult>
|
|
62
|
+
|
|
63
|
+
ascend(params: AscendParams): Promise<TransactionResult>
|
|
64
|
+
claimSpoils(params: ClaimSpoilsParams): Promise<TransactionResult>
|
|
65
|
+
defect(params: DefectParams): Promise<TransactionResult>
|
|
66
|
+
fud(params: FudFactionParams): Promise<TransactionResult>
|
|
67
|
+
join(params: JoinFactionParams): Promise<JoinFactionResult>
|
|
68
|
+
launch(params: LaunchFactionParams): Promise<LaunchFactionResult>
|
|
69
|
+
message(params: MessageFactionParams): Promise<TransactionResult>
|
|
70
|
+
rally(params: RallyParams): Promise<TransactionResult>
|
|
71
|
+
raze(params: RazeParams): Promise<TransactionResult>
|
|
72
|
+
repayWarLoan(params: RepayWarLoanParams): Promise<TransactionResult>
|
|
73
|
+
requestWarLoan(params: RequestWarLoanParams): Promise<TransactionResult>
|
|
74
|
+
siege(params: SiegeParams): Promise<TransactionResult>
|
|
75
|
+
tithe(params: TitheParams): Promise<TransactionResult>
|
|
76
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentFactionPosition,
|
|
3
|
+
AgentProfile,
|
|
4
|
+
AllianceCluster,
|
|
5
|
+
FactionPower,
|
|
6
|
+
FactionStatus,
|
|
7
|
+
RivalFaction,
|
|
8
|
+
WorldEvent,
|
|
9
|
+
WorldStats,
|
|
10
|
+
} from '../types'
|
|
11
|
+
|
|
12
|
+
export interface Intel {
|
|
13
|
+
getAgentFactions(wallet: string, factionLimit?: number): Promise<AgentFactionPosition[]>
|
|
14
|
+
getAgentProfile(wallet: string): Promise<AgentProfile>
|
|
15
|
+
getAgentSolLamports(wallet: string): Promise<number>
|
|
16
|
+
getAllies(mints: string[], holderLimit?: number): Promise<AllianceCluster[]>
|
|
17
|
+
getFactionPower(mint: string): Promise<FactionPower>
|
|
18
|
+
getFactionLeaderboard(opts?: { status?: FactionStatus; limit?: number }): Promise<FactionPower[]>
|
|
19
|
+
getFactionRivals(mint: string, opts?: { limit?: number }): Promise<RivalFaction[]>
|
|
20
|
+
getWorldFeed(opts?: { limit?: number; factionLimit?: number }): Promise<WorldEvent[]>
|
|
21
|
+
getWorldStats(): Promise<WorldStats>
|
|
22
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AllLoanPositionsResult,
|
|
3
|
+
BuyTransactionResult,
|
|
4
|
+
CreateTokenResult,
|
|
5
|
+
Holder,
|
|
6
|
+
HoldersResult,
|
|
7
|
+
LendingInfo,
|
|
8
|
+
LoanPositionInfo,
|
|
9
|
+
LoanPositionWithKey,
|
|
10
|
+
MessagesResult,
|
|
11
|
+
TokenDetail,
|
|
12
|
+
TokenListResult,
|
|
13
|
+
TokenMessage,
|
|
14
|
+
TokenStatus,
|
|
15
|
+
TokenStatusFilter,
|
|
16
|
+
TokenSummary,
|
|
17
|
+
VaultInfo,
|
|
18
|
+
VaultWalletLinkInfo,
|
|
19
|
+
} from 'torchsdk'
|
|
20
|
+
import {
|
|
21
|
+
AgentLink,
|
|
22
|
+
AllWarLoansResult,
|
|
23
|
+
Comms,
|
|
24
|
+
CommsResult,
|
|
25
|
+
FactionDetail,
|
|
26
|
+
FactionListResult,
|
|
27
|
+
FactionStatus,
|
|
28
|
+
FactionStatusFilter,
|
|
29
|
+
FactionSummary,
|
|
30
|
+
JoinFactionResult,
|
|
31
|
+
LaunchFactionResult,
|
|
32
|
+
Member,
|
|
33
|
+
MembersResult,
|
|
34
|
+
Strategy,
|
|
35
|
+
Stronghold,
|
|
36
|
+
WarChest,
|
|
37
|
+
WarLoan,
|
|
38
|
+
WarLoanWithAgent,
|
|
39
|
+
} from '../types'
|
|
40
|
+
|
|
41
|
+
export interface Mapper {
|
|
42
|
+
allLoansResult(r: AllLoanPositionsResult): AllWarLoansResult
|
|
43
|
+
buyResult(r: BuyTransactionResult): JoinFactionResult
|
|
44
|
+
createResult(r: CreateTokenResult): LaunchFactionResult
|
|
45
|
+
factionStatus(status: TokenStatus): FactionStatus
|
|
46
|
+
holdersResult(r: HoldersResult): MembersResult
|
|
47
|
+
holderToMember(h: Holder): Member
|
|
48
|
+
lendingToWarChest(l: LendingInfo): WarChest
|
|
49
|
+
loanToWarLoan(l: LoanPositionInfo): WarLoan
|
|
50
|
+
loanWithKeyToWarLoan(l: LoanPositionWithKey): WarLoanWithAgent
|
|
51
|
+
messagesResult(r: MessagesResult): CommsResult
|
|
52
|
+
strategy(vote: 'burn' | 'return'): Strategy
|
|
53
|
+
tokenDetailToFaction(t: TokenDetail): FactionDetail
|
|
54
|
+
tokenListResult(r: TokenListResult): FactionListResult
|
|
55
|
+
tokenMessageToComms(m: TokenMessage): Comms
|
|
56
|
+
tokenStatus(status: FactionStatus): TokenStatus
|
|
57
|
+
tokenStatusFilter(status: FactionStatusFilter): TokenStatusFilter
|
|
58
|
+
tokenSummaryToFaction(t: TokenSummary): FactionSummary
|
|
59
|
+
vote(strategy: Strategy): 'burn' | 'return'
|
|
60
|
+
vaultToStronghold(v: VaultInfo): Stronghold
|
|
61
|
+
walletLinkToAgentLink(l: VaultWalletLinkInfo): AgentLink
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const STATUS_MAP: Record<TokenStatus, FactionStatus> = {
|
|
65
|
+
bonding: 'rising',
|
|
66
|
+
complete: 'ready',
|
|
67
|
+
migrated: 'ascended',
|
|
68
|
+
reclaimed: 'razed',
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const STATUS_REVERSE: Record<FactionStatus, TokenStatus> = {
|
|
72
|
+
rising: 'bonding',
|
|
73
|
+
ready: 'complete',
|
|
74
|
+
ascended: 'migrated',
|
|
75
|
+
razed: 'reclaimed',
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const STATUS_FILTER_REVERSE: Record<FactionStatusFilter, TokenStatusFilter> = {
|
|
79
|
+
rising: 'bonding',
|
|
80
|
+
ready: 'complete',
|
|
81
|
+
ascended: 'migrated',
|
|
82
|
+
razed: 'reclaimed',
|
|
83
|
+
all: 'all',
|
|
84
|
+
}
|
|
File without changes
|