pyre-world-kit 1.0.11 → 1.0.12
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 +5 -1
- package/dist/actions.js +47 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -2
- package/dist/types.d.ts +16 -0
- package/package.json +1 -1
- package/src/actions.ts +55 -0
- package/src/index.ts +4 -0
- package/src/types.ts +18 -0
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, 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 } 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 */
|
|
@@ -57,6 +57,10 @@ export declare function joinFaction(connection: Connection, params: JoinFactionP
|
|
|
57
57
|
export declare function directJoinFaction(connection: Connection, params: DirectJoinFactionParams): Promise<JoinFactionResult>;
|
|
58
58
|
/** Defect from a faction (sell tokens) */
|
|
59
59
|
export declare function defect(connection: Connection, params: DefectParams): Promise<TransactionResult>;
|
|
60
|
+
/** "Said in" — micro buy (0.001 SOL) + message. Routes through bonding curve or DEX automatically. */
|
|
61
|
+
export declare function messageFaction(connection: Connection, params: MessageFactionParams): Promise<TransactionResult>;
|
|
62
|
+
/** "Argued in" — micro sell (100 tokens) + negative message. Routes through bonding curve or DEX automatically. */
|
|
63
|
+
export declare function fudFaction(connection: Connection, params: FudFactionParams): Promise<TransactionResult>;
|
|
60
64
|
/** Rally support for a faction (star) */
|
|
61
65
|
export declare function rally(connection: Connection, params: RallyParams): Promise<TransactionResult>;
|
|
62
66
|
/** Request a war loan (borrow SOL against token collateral) */
|
package/dist/actions.js
CHANGED
|
@@ -30,6 +30,8 @@ exports.launchFaction = launchFaction;
|
|
|
30
30
|
exports.joinFaction = joinFaction;
|
|
31
31
|
exports.directJoinFaction = directJoinFaction;
|
|
32
32
|
exports.defect = defect;
|
|
33
|
+
exports.messageFaction = messageFaction;
|
|
34
|
+
exports.fudFaction = fudFaction;
|
|
33
35
|
exports.rally = rally;
|
|
34
36
|
exports.requestWarLoan = requestWarLoan;
|
|
35
37
|
exports.repayWarLoan = repayWarLoan;
|
|
@@ -333,6 +335,51 @@ async function defect(connection, params) {
|
|
|
333
335
|
vault: params.stronghold,
|
|
334
336
|
});
|
|
335
337
|
}
|
|
338
|
+
/** "Said in" — micro buy (0.001 SOL) + message. Routes through bonding curve or DEX automatically. */
|
|
339
|
+
async function messageFaction(connection, params) {
|
|
340
|
+
const MICRO_BUY_LAMPORTS = 1_000; // 0.001 SOL
|
|
341
|
+
if (params.ascended) {
|
|
342
|
+
return (0, torchsdk_1.buildVaultSwapTransaction)(connection, {
|
|
343
|
+
mint: params.mint,
|
|
344
|
+
signer: params.agent,
|
|
345
|
+
vault_creator: params.stronghold,
|
|
346
|
+
amount_in: MICRO_BUY_LAMPORTS,
|
|
347
|
+
minimum_amount_out: 1,
|
|
348
|
+
is_buy: true,
|
|
349
|
+
message: params.message,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
const result = await (0, torchsdk_1.buildBuyTransaction)(connection, {
|
|
353
|
+
mint: params.mint,
|
|
354
|
+
buyer: params.agent,
|
|
355
|
+
amount_sol: MICRO_BUY_LAMPORTS,
|
|
356
|
+
message: params.message,
|
|
357
|
+
vault: params.stronghold,
|
|
358
|
+
});
|
|
359
|
+
return (0, mappers_1.mapBuyResult)(result);
|
|
360
|
+
}
|
|
361
|
+
/** "Argued in" — micro sell (100 tokens) + negative message. Routes through bonding curve or DEX automatically. */
|
|
362
|
+
async function fudFaction(connection, params) {
|
|
363
|
+
const MICRO_SELL_TOKENS = 100;
|
|
364
|
+
if (params.ascended) {
|
|
365
|
+
return (0, torchsdk_1.buildVaultSwapTransaction)(connection, {
|
|
366
|
+
mint: params.mint,
|
|
367
|
+
signer: params.agent,
|
|
368
|
+
vault_creator: params.stronghold,
|
|
369
|
+
amount_in: MICRO_SELL_TOKENS,
|
|
370
|
+
minimum_amount_out: 1,
|
|
371
|
+
is_buy: false,
|
|
372
|
+
message: params.message,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return (0, torchsdk_1.buildSellTransaction)(connection, {
|
|
376
|
+
mint: params.mint,
|
|
377
|
+
seller: params.agent,
|
|
378
|
+
amount_tokens: MICRO_SELL_TOKENS,
|
|
379
|
+
message: params.message,
|
|
380
|
+
vault: params.stronghold,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
336
383
|
/** Rally support for a faction (star) */
|
|
337
384
|
async function rally(connection, params) {
|
|
338
385
|
return (0, torchsdk_1.buildStarTransaction)(connection, {
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This kit translates protocol primitives into faction warfare language
|
|
6
6
|
* so agents think in factions, not tokens.
|
|
7
7
|
*/
|
|
8
|
-
export type { FactionStatus, FactionTier, Strategy, AgentHealth, FactionSummary, FactionDetail, Stronghold, AgentLink, Comms, WarChest, WarLoan, WarLoanWithAgent, Member, FactionListResult, MembersResult, CommsResult, AllWarLoansResult, WarLoanQuote, LaunchFactionParams, JoinFactionParams, DirectJoinFactionParams, DefectParams, RallyParams, RequestWarLoanParams, RepayWarLoanParams, SiegeParams, TradeOnDexParams, ClaimSpoilsParams, CreateStrongholdParams, FundStrongholdParams, WithdrawFromStrongholdParams, RecruitAgentParams, ExileAgentParams, CoupParams, WithdrawAssetsParams, AscendParams, RazeParams, TitheParams, ConvertTitheParams, JoinFactionResult, LaunchFactionResult, TransactionResult, EphemeralAgent, SaidVerification, ConfirmResult, FactionSortOption, FactionStatusFilter, FactionListParams, FactionPower, AllianceCluster, RivalFaction, AgentProfile, AgentFactionPosition, WorldEventType, WorldEvent, WorldStats, } from './types';
|
|
9
|
-
export { getFactions, getFaction, getMembers, getComms, getJoinQuote, getDefectQuote, getStronghold, getStrongholdForAgent, getAgentLink, getWarChest, getWarLoan, getAllWarLoans, getMaxWarLoan, blacklistMints, isBlacklistedMint, getBlacklistedMints, launchFaction, joinFaction, directJoinFaction, defect, rally, requestWarLoan, repayWarLoan, tradeOnDex, claimSpoils, createStronghold, fundStronghold, withdrawFromStronghold, recruitAgent, exileAgent, coup, withdrawAssets, siege, ascend, raze, tithe, convertTithe, verifyAgent, confirmAction, createEphemeralAgent, getDexPool, getDexVaults, } from './actions';
|
|
8
|
+
export type { FactionStatus, FactionTier, Strategy, AgentHealth, FactionSummary, FactionDetail, Stronghold, AgentLink, Comms, WarChest, WarLoan, WarLoanWithAgent, Member, FactionListResult, MembersResult, CommsResult, AllWarLoansResult, WarLoanQuote, 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, TransactionResult, EphemeralAgent, SaidVerification, ConfirmResult, FactionSortOption, FactionStatusFilter, FactionListParams, FactionPower, AllianceCluster, RivalFaction, AgentProfile, AgentFactionPosition, WorldEventType, WorldEvent, WorldStats, } from './types';
|
|
9
|
+
export { getFactions, getFaction, getMembers, getComms, getJoinQuote, getDefectQuote, getStronghold, getStrongholdForAgent, getAgentLink, getWarChest, getWarLoan, getAllWarLoans, getMaxWarLoan, blacklistMints, isBlacklistedMint, getBlacklistedMints, launchFaction, joinFaction, directJoinFaction, defect, messageFaction, fudFaction, rally, requestWarLoan, repayWarLoan, tradeOnDex, claimSpoils, createStronghold, fundStronghold, withdrawFromStronghold, recruitAgent, exileAgent, coup, withdrawAssets, siege, ascend, raze, tithe, convertTithe, verifyAgent, confirmAction, createEphemeralAgent, getDexPool, getDexVaults, } from './actions';
|
|
10
10
|
export { getFactionPower, getFactionLeaderboard, detectAlliances, getFactionRivals, getAgentProfile, getAgentFactions, getWorldFeed, getWorldStats, } from './intel';
|
|
11
11
|
export { isPyreMint, grindPyreMint } from './vanity';
|
|
12
12
|
export { PROGRAM_ID, LAMPORTS_PER_SOL, TOKEN_MULTIPLIER, TOTAL_SUPPLY } from 'torchsdk';
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* so agents think in factions, not tokens.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
11
|
-
exports.TOTAL_SUPPLY = exports.TOKEN_MULTIPLIER = exports.LAMPORTS_PER_SOL = exports.PROGRAM_ID = exports.grindPyreMint = exports.isPyreMint = void 0;
|
|
10
|
+
exports.getAgentFactions = exports.getAgentProfile = exports.getFactionRivals = exports.detectAlliances = exports.getFactionLeaderboard = exports.getFactionPower = exports.getDexVaults = exports.getDexPool = exports.createEphemeralAgent = exports.confirmAction = exports.verifyAgent = exports.convertTithe = exports.tithe = exports.raze = exports.ascend = exports.siege = exports.withdrawAssets = exports.coup = exports.exileAgent = exports.recruitAgent = exports.withdrawFromStronghold = exports.fundStronghold = exports.createStronghold = exports.claimSpoils = exports.tradeOnDex = exports.repayWarLoan = exports.requestWarLoan = exports.rally = exports.fudFaction = exports.messageFaction = exports.defect = exports.directJoinFaction = exports.joinFaction = exports.launchFaction = exports.getBlacklistedMints = exports.isBlacklistedMint = exports.blacklistMints = exports.getMaxWarLoan = exports.getAllWarLoans = exports.getWarLoan = exports.getWarChest = exports.getAgentLink = exports.getStrongholdForAgent = exports.getStronghold = exports.getDefectQuote = exports.getJoinQuote = exports.getComms = exports.getMembers = exports.getFaction = exports.getFactions = void 0;
|
|
11
|
+
exports.TOTAL_SUPPLY = exports.TOKEN_MULTIPLIER = exports.LAMPORTS_PER_SOL = exports.PROGRAM_ID = exports.grindPyreMint = exports.isPyreMint = exports.getWorldStats = exports.getWorldFeed = void 0;
|
|
12
12
|
// ─── Actions ───────────────────────────────────────────────────────
|
|
13
13
|
var actions_1 = require("./actions");
|
|
14
14
|
// Read operations
|
|
@@ -34,6 +34,8 @@ Object.defineProperty(exports, "launchFaction", { enumerable: true, get: functio
|
|
|
34
34
|
Object.defineProperty(exports, "joinFaction", { enumerable: true, get: function () { return actions_1.joinFaction; } });
|
|
35
35
|
Object.defineProperty(exports, "directJoinFaction", { enumerable: true, get: function () { return actions_1.directJoinFaction; } });
|
|
36
36
|
Object.defineProperty(exports, "defect", { enumerable: true, get: function () { return actions_1.defect; } });
|
|
37
|
+
Object.defineProperty(exports, "messageFaction", { enumerable: true, get: function () { return actions_1.messageFaction; } });
|
|
38
|
+
Object.defineProperty(exports, "fudFaction", { enumerable: true, get: function () { return actions_1.fudFaction; } });
|
|
37
39
|
Object.defineProperty(exports, "rally", { enumerable: true, get: function () { return actions_1.rally; } });
|
|
38
40
|
Object.defineProperty(exports, "requestWarLoan", { enumerable: true, get: function () { return actions_1.requestWarLoan; } });
|
|
39
41
|
Object.defineProperty(exports, "repayWarLoan", { enumerable: true, get: function () { return actions_1.repayWarLoan; } });
|
package/dist/types.d.ts
CHANGED
|
@@ -186,6 +186,22 @@ export interface DefectParams {
|
|
|
186
186
|
message?: string;
|
|
187
187
|
stronghold?: string;
|
|
188
188
|
}
|
|
189
|
+
/** "Said in" — micro buy + message (costs 0.001 SOL) */
|
|
190
|
+
export interface MessageFactionParams {
|
|
191
|
+
mint: string;
|
|
192
|
+
agent: string;
|
|
193
|
+
message: string;
|
|
194
|
+
stronghold: string;
|
|
195
|
+
ascended?: boolean;
|
|
196
|
+
}
|
|
197
|
+
/** "Argued in" — micro sell + negative message (sells 100 tokens) */
|
|
198
|
+
export interface FudFactionParams {
|
|
199
|
+
mint: string;
|
|
200
|
+
agent: string;
|
|
201
|
+
message: string;
|
|
202
|
+
stronghold: string;
|
|
203
|
+
ascended?: boolean;
|
|
204
|
+
}
|
|
189
205
|
export interface RallyParams {
|
|
190
206
|
mint: string;
|
|
191
207
|
agent: string;
|
package/package.json
CHANGED
package/src/actions.ts
CHANGED
|
@@ -67,6 +67,8 @@ import type {
|
|
|
67
67
|
JoinFactionParams,
|
|
68
68
|
DirectJoinFactionParams,
|
|
69
69
|
DefectParams,
|
|
70
|
+
MessageFactionParams,
|
|
71
|
+
FudFactionParams,
|
|
70
72
|
RallyParams,
|
|
71
73
|
RequestWarLoanParams,
|
|
72
74
|
RepayWarLoanParams,
|
|
@@ -492,6 +494,59 @@ export async function defect(
|
|
|
492
494
|
});
|
|
493
495
|
}
|
|
494
496
|
|
|
497
|
+
/** "Said in" — micro buy (0.001 SOL) + message. Routes through bonding curve or DEX automatically. */
|
|
498
|
+
export async function messageFaction(
|
|
499
|
+
connection: Connection,
|
|
500
|
+
params: MessageFactionParams,
|
|
501
|
+
): Promise<TransactionResult> {
|
|
502
|
+
const MICRO_BUY_LAMPORTS = 1_000; // 0.001 SOL
|
|
503
|
+
if (params.ascended) {
|
|
504
|
+
return buildVaultSwapTransaction(connection, {
|
|
505
|
+
mint: params.mint,
|
|
506
|
+
signer: params.agent,
|
|
507
|
+
vault_creator: params.stronghold,
|
|
508
|
+
amount_in: MICRO_BUY_LAMPORTS,
|
|
509
|
+
minimum_amount_out: 1,
|
|
510
|
+
is_buy: true,
|
|
511
|
+
message: params.message,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
const result = await buildBuyTransaction(connection, {
|
|
515
|
+
mint: params.mint,
|
|
516
|
+
buyer: params.agent,
|
|
517
|
+
amount_sol: MICRO_BUY_LAMPORTS,
|
|
518
|
+
message: params.message,
|
|
519
|
+
vault: params.stronghold,
|
|
520
|
+
});
|
|
521
|
+
return mapBuyResult(result);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/** "Argued in" — micro sell (100 tokens) + negative message. Routes through bonding curve or DEX automatically. */
|
|
525
|
+
export async function fudFaction(
|
|
526
|
+
connection: Connection,
|
|
527
|
+
params: FudFactionParams,
|
|
528
|
+
): Promise<TransactionResult> {
|
|
529
|
+
const MICRO_SELL_TOKENS = 100;
|
|
530
|
+
if (params.ascended) {
|
|
531
|
+
return buildVaultSwapTransaction(connection, {
|
|
532
|
+
mint: params.mint,
|
|
533
|
+
signer: params.agent,
|
|
534
|
+
vault_creator: params.stronghold,
|
|
535
|
+
amount_in: MICRO_SELL_TOKENS,
|
|
536
|
+
minimum_amount_out: 1,
|
|
537
|
+
is_buy: false,
|
|
538
|
+
message: params.message,
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
return buildSellTransaction(connection, {
|
|
542
|
+
mint: params.mint,
|
|
543
|
+
seller: params.agent,
|
|
544
|
+
amount_tokens: MICRO_SELL_TOKENS,
|
|
545
|
+
message: params.message,
|
|
546
|
+
vault: params.stronghold,
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
|
|
495
550
|
/** Rally support for a faction (star) */
|
|
496
551
|
export async function rally(
|
|
497
552
|
connection: Connection,
|
package/src/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ export type {
|
|
|
35
35
|
JoinFactionParams,
|
|
36
36
|
DirectJoinFactionParams,
|
|
37
37
|
DefectParams,
|
|
38
|
+
MessageFactionParams,
|
|
39
|
+
FudFactionParams,
|
|
38
40
|
RallyParams,
|
|
39
41
|
RequestWarLoanParams,
|
|
40
42
|
RepayWarLoanParams,
|
|
@@ -100,6 +102,8 @@ export {
|
|
|
100
102
|
joinFaction,
|
|
101
103
|
directJoinFaction,
|
|
102
104
|
defect,
|
|
105
|
+
messageFaction,
|
|
106
|
+
fudFaction,
|
|
103
107
|
rally,
|
|
104
108
|
requestWarLoan,
|
|
105
109
|
repayWarLoan,
|
package/src/types.ts
CHANGED
|
@@ -224,6 +224,24 @@ export interface DefectParams {
|
|
|
224
224
|
stronghold?: string;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
/** "Said in" — micro buy + message (costs 0.001 SOL) */
|
|
228
|
+
export interface MessageFactionParams {
|
|
229
|
+
mint: string;
|
|
230
|
+
agent: string;
|
|
231
|
+
message: string;
|
|
232
|
+
stronghold: string;
|
|
233
|
+
ascended?: boolean;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** "Argued in" — micro sell + negative message (sells 100 tokens) */
|
|
237
|
+
export interface FudFactionParams {
|
|
238
|
+
mint: string;
|
|
239
|
+
agent: string;
|
|
240
|
+
message: string;
|
|
241
|
+
stronghold: string;
|
|
242
|
+
ascended?: boolean;
|
|
243
|
+
}
|
|
244
|
+
|
|
227
245
|
export interface RallyParams {
|
|
228
246
|
mint: string;
|
|
229
247
|
agent: string;
|