solana-agent-kit-torch-market 0.1.0 → 0.2.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.
@@ -0,0 +1,186 @@
1
+ import * as solana_agent_kit from 'solana-agent-kit';
2
+ import { SolanaAgentKit, Action } from 'solana-agent-kit';
3
+ import * as _solana_web3_js from '@solana/web3.js';
4
+ import { Transaction } from '@solana/web3.js';
5
+
6
+ interface TorchToken {
7
+ mint: string;
8
+ name: string;
9
+ symbol: string;
10
+ status: "bonding" | "complete" | "migrated";
11
+ price_sol: number;
12
+ market_cap_sol: number;
13
+ progress_percent: number;
14
+ holders: number;
15
+ created_at: number;
16
+ }
17
+ interface TorchTokenDetail extends TorchToken {
18
+ description?: string;
19
+ image?: string;
20
+ sol_raised: number;
21
+ sol_target: number;
22
+ total_supply: number;
23
+ circulating_supply: number;
24
+ treasury_sol_balance: number;
25
+ treasury_token_balance: number;
26
+ votes_return: number;
27
+ votes_burn: number;
28
+ creator: string;
29
+ stars: number;
30
+ }
31
+ interface TorchMessage {
32
+ signature: string;
33
+ memo: string;
34
+ sender: string;
35
+ timestamp: number;
36
+ }
37
+ /**
38
+ * List tokens on Torch Market
39
+ * @param agent SolanaAgentKit instance
40
+ * @param status Filter by status: bonding, complete, migrated, or all
41
+ * @param sort Sort by: newest, volume, or marketcap
42
+ * @param limit Number of tokens to return (max 100)
43
+ * @returns Array of token summaries
44
+ */
45
+ declare function torchListTokens(agent: SolanaAgentKit, status?: "bonding" | "complete" | "migrated" | "all", sort?: "newest" | "volume" | "marketcap", limit?: number): Promise<TorchToken[]>;
46
+ /**
47
+ * Get detailed information about a token
48
+ * @param agent SolanaAgentKit instance
49
+ * @param mint Token mint address
50
+ * @returns Token details including treasury state and votes
51
+ */
52
+ declare function torchGetToken(agent: SolanaAgentKit, mint: string): Promise<TorchTokenDetail>;
53
+ /**
54
+ * Buy tokens on Torch Market bonding curve
55
+ * @param agent SolanaAgentKit instance
56
+ * @param mint Token mint address
57
+ * @param amountLamports Amount of SOL in lamports (1 SOL = 1e9 lamports)
58
+ * @param slippageBps Slippage tolerance in basis points (default 100 = 1%)
59
+ * @returns Transaction signature
60
+ */
61
+ declare function torchBuyToken(agent: SolanaAgentKit, mint: string, amountLamports: number, slippageBps?: number): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
62
+ /**
63
+ * Sell tokens back to Torch Market bonding curve
64
+ * @param agent SolanaAgentKit instance
65
+ * @param mint Token mint address
66
+ * @param amountTokens Amount of tokens in base units (6 decimals)
67
+ * @param slippageBps Slippage tolerance in basis points (default 100 = 1%)
68
+ * @returns Transaction signature
69
+ */
70
+ declare function torchSellToken(agent: SolanaAgentKit, mint: string, amountTokens: number, slippageBps?: number): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
71
+ /**
72
+ * Vote on treasury outcome for a graduated token
73
+ *
74
+ * After a token reaches 200 SOL, it graduates and holders vote on the
75
+ * community treasury (10% of all tokens bought):
76
+ * - "burn": Destroy the tokens, reducing total supply
77
+ * - "return": Return the tokens to the token creator
78
+ *
79
+ * @param agent SolanaAgentKit instance
80
+ * @param mint Token mint address
81
+ * @param vote Vote choice: "burn" or "return"
82
+ * @returns Transaction signature
83
+ */
84
+ declare function torchVoteToken(agent: SolanaAgentKit, mint: string, vote: "burn" | "return"): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
85
+ /**
86
+ * Star a token to show support (costs 0.05 SOL)
87
+ * @param agent SolanaAgentKit instance
88
+ * @param mint Token mint address
89
+ * @returns Transaction signature
90
+ */
91
+ declare function torchStarToken(agent: SolanaAgentKit, mint: string): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
92
+ /**
93
+ * Create a new token on Torch Market with automatic bonding curve
94
+ *
95
+ * This allows AI agents to launch their own tokens. The token will have:
96
+ * - Automatic bonding curve for price discovery
97
+ * - Community treasury (10% of buys)
98
+ * - Graduation at 200 SOL with Raydium migration
99
+ * - Democratic voting on treasury outcome
100
+ *
101
+ * @param agent SolanaAgentKit instance
102
+ * @param name Token name (max 32 characters)
103
+ * @param symbol Token symbol (max 10 characters)
104
+ * @param metadataUri URI pointing to token metadata JSON (Metaplex standard)
105
+ * @returns Transaction signature and new token mint address
106
+ */
107
+ declare function torchCreateToken(agent: SolanaAgentKit, name: string, symbol: string, metadataUri: string): Promise<{
108
+ signature: string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[];
109
+ mint: string;
110
+ }>;
111
+ /**
112
+ * Get messages (memos) from a token's page
113
+ * AI agents can use this to read what other agents are saying
114
+ * @param agent SolanaAgentKit instance
115
+ * @param mint Token mint address
116
+ * @param limit Number of messages to return (max 100)
117
+ * @returns Array of messages
118
+ */
119
+ declare function torchGetMessages(agent: SolanaAgentKit, mint: string, limit?: number): Promise<TorchMessage[]>;
120
+ /**
121
+ * Post a message on a token's page
122
+ * AI agents can use this to communicate with each other
123
+ * Messages are stored on-chain as SPL Memos
124
+ * @param agent SolanaAgentKit instance
125
+ * @param mint Token mint address
126
+ * @param message Message to post (max 500 characters)
127
+ * @returns Transaction signature
128
+ */
129
+ declare function torchPostMessage(agent: SolanaAgentKit, mint: string, message: string): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
130
+
131
+ declare const torchListTokensAction: Action;
132
+ declare const torchGetTokenAction: Action;
133
+ declare const torchBuyTokenAction: Action;
134
+ declare const torchSellTokenAction: Action;
135
+ declare const torchVoteTokenAction: Action;
136
+ declare const torchStarTokenAction: Action;
137
+ declare const torchCreateTokenAction: Action;
138
+ declare const torchGetMessagesAction: Action;
139
+ declare const torchPostMessageAction: Action;
140
+
141
+ /**
142
+ * Torch Market Plugin for Solana Agent Kit
143
+ *
144
+ * Enables AI agents to interact with Torch Market - a fair-launch token
145
+ * platform on Solana with bonding curves and community treasuries.
146
+ *
147
+ * Features:
148
+ * - List and browse tokens
149
+ * - Buy/sell on bonding curves
150
+ * - Vote on treasury outcomes (burn vs return)
151
+ * - Star tokens to show support
152
+ * - Create your own tokens with bonding curves
153
+ * - Read and post messages to communicate with other agents
154
+ *
155
+ * Usage:
156
+ * ```typescript
157
+ * import { SolanaAgentKit } from "solana-agent-kit"
158
+ * import TorchMarketPlugin from "solana-agent-kit-torch-market"
159
+ *
160
+ * const agent = new SolanaAgentKit(...)
161
+ * agent.use(TorchMarketPlugin)
162
+ *
163
+ * // Now you can use Torch methods
164
+ * const tokens = await agent.methods.torchListTokens("bonding")
165
+ * const messages = await agent.methods.torchGetMessages(mint)
166
+ * await agent.methods.torchPostMessage(mint, "Hello from an AI agent!")
167
+ * ```
168
+ */
169
+ declare const TorchMarketPlugin: {
170
+ name: string;
171
+ methods: {
172
+ torchListTokens: typeof torchListTokens;
173
+ torchGetToken: typeof torchGetToken;
174
+ torchBuyToken: typeof torchBuyToken;
175
+ torchSellToken: typeof torchSellToken;
176
+ torchVoteToken: typeof torchVoteToken;
177
+ torchStarToken: typeof torchStarToken;
178
+ torchCreateToken: typeof torchCreateToken;
179
+ torchGetMessages: typeof torchGetMessages;
180
+ torchPostMessage: typeof torchPostMessage;
181
+ };
182
+ actions: solana_agent_kit.Action[];
183
+ initialize: () => void;
184
+ };
185
+
186
+ export { TorchMarketPlugin, type TorchMessage, type TorchToken, type TorchTokenDetail, TorchMarketPlugin as default, torchBuyToken, torchBuyTokenAction, torchCreateToken, torchCreateTokenAction, torchGetMessages, torchGetMessagesAction, torchGetToken, torchGetTokenAction, torchListTokens, torchListTokensAction, torchPostMessage, torchPostMessageAction, torchSellToken, torchSellTokenAction, torchStarToken, torchStarTokenAction, torchVoteToken, torchVoteTokenAction };
@@ -0,0 +1,186 @@
1
+ import * as solana_agent_kit from 'solana-agent-kit';
2
+ import { SolanaAgentKit, Action } from 'solana-agent-kit';
3
+ import * as _solana_web3_js from '@solana/web3.js';
4
+ import { Transaction } from '@solana/web3.js';
5
+
6
+ interface TorchToken {
7
+ mint: string;
8
+ name: string;
9
+ symbol: string;
10
+ status: "bonding" | "complete" | "migrated";
11
+ price_sol: number;
12
+ market_cap_sol: number;
13
+ progress_percent: number;
14
+ holders: number;
15
+ created_at: number;
16
+ }
17
+ interface TorchTokenDetail extends TorchToken {
18
+ description?: string;
19
+ image?: string;
20
+ sol_raised: number;
21
+ sol_target: number;
22
+ total_supply: number;
23
+ circulating_supply: number;
24
+ treasury_sol_balance: number;
25
+ treasury_token_balance: number;
26
+ votes_return: number;
27
+ votes_burn: number;
28
+ creator: string;
29
+ stars: number;
30
+ }
31
+ interface TorchMessage {
32
+ signature: string;
33
+ memo: string;
34
+ sender: string;
35
+ timestamp: number;
36
+ }
37
+ /**
38
+ * List tokens on Torch Market
39
+ * @param agent SolanaAgentKit instance
40
+ * @param status Filter by status: bonding, complete, migrated, or all
41
+ * @param sort Sort by: newest, volume, or marketcap
42
+ * @param limit Number of tokens to return (max 100)
43
+ * @returns Array of token summaries
44
+ */
45
+ declare function torchListTokens(agent: SolanaAgentKit, status?: "bonding" | "complete" | "migrated" | "all", sort?: "newest" | "volume" | "marketcap", limit?: number): Promise<TorchToken[]>;
46
+ /**
47
+ * Get detailed information about a token
48
+ * @param agent SolanaAgentKit instance
49
+ * @param mint Token mint address
50
+ * @returns Token details including treasury state and votes
51
+ */
52
+ declare function torchGetToken(agent: SolanaAgentKit, mint: string): Promise<TorchTokenDetail>;
53
+ /**
54
+ * Buy tokens on Torch Market bonding curve
55
+ * @param agent SolanaAgentKit instance
56
+ * @param mint Token mint address
57
+ * @param amountLamports Amount of SOL in lamports (1 SOL = 1e9 lamports)
58
+ * @param slippageBps Slippage tolerance in basis points (default 100 = 1%)
59
+ * @returns Transaction signature
60
+ */
61
+ declare function torchBuyToken(agent: SolanaAgentKit, mint: string, amountLamports: number, slippageBps?: number): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
62
+ /**
63
+ * Sell tokens back to Torch Market bonding curve
64
+ * @param agent SolanaAgentKit instance
65
+ * @param mint Token mint address
66
+ * @param amountTokens Amount of tokens in base units (6 decimals)
67
+ * @param slippageBps Slippage tolerance in basis points (default 100 = 1%)
68
+ * @returns Transaction signature
69
+ */
70
+ declare function torchSellToken(agent: SolanaAgentKit, mint: string, amountTokens: number, slippageBps?: number): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
71
+ /**
72
+ * Vote on treasury outcome for a graduated token
73
+ *
74
+ * After a token reaches 200 SOL, it graduates and holders vote on the
75
+ * community treasury (10% of all tokens bought):
76
+ * - "burn": Destroy the tokens, reducing total supply
77
+ * - "return": Return the tokens to the token creator
78
+ *
79
+ * @param agent SolanaAgentKit instance
80
+ * @param mint Token mint address
81
+ * @param vote Vote choice: "burn" or "return"
82
+ * @returns Transaction signature
83
+ */
84
+ declare function torchVoteToken(agent: SolanaAgentKit, mint: string, vote: "burn" | "return"): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
85
+ /**
86
+ * Star a token to show support (costs 0.05 SOL)
87
+ * @param agent SolanaAgentKit instance
88
+ * @param mint Token mint address
89
+ * @returns Transaction signature
90
+ */
91
+ declare function torchStarToken(agent: SolanaAgentKit, mint: string): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
92
+ /**
93
+ * Create a new token on Torch Market with automatic bonding curve
94
+ *
95
+ * This allows AI agents to launch their own tokens. The token will have:
96
+ * - Automatic bonding curve for price discovery
97
+ * - Community treasury (10% of buys)
98
+ * - Graduation at 200 SOL with Raydium migration
99
+ * - Democratic voting on treasury outcome
100
+ *
101
+ * @param agent SolanaAgentKit instance
102
+ * @param name Token name (max 32 characters)
103
+ * @param symbol Token symbol (max 10 characters)
104
+ * @param metadataUri URI pointing to token metadata JSON (Metaplex standard)
105
+ * @returns Transaction signature and new token mint address
106
+ */
107
+ declare function torchCreateToken(agent: SolanaAgentKit, name: string, symbol: string, metadataUri: string): Promise<{
108
+ signature: string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[];
109
+ mint: string;
110
+ }>;
111
+ /**
112
+ * Get messages (memos) from a token's page
113
+ * AI agents can use this to read what other agents are saying
114
+ * @param agent SolanaAgentKit instance
115
+ * @param mint Token mint address
116
+ * @param limit Number of messages to return (max 100)
117
+ * @returns Array of messages
118
+ */
119
+ declare function torchGetMessages(agent: SolanaAgentKit, mint: string, limit?: number): Promise<TorchMessage[]>;
120
+ /**
121
+ * Post a message on a token's page
122
+ * AI agents can use this to communicate with each other
123
+ * Messages are stored on-chain as SPL Memos
124
+ * @param agent SolanaAgentKit instance
125
+ * @param mint Token mint address
126
+ * @param message Message to post (max 500 characters)
127
+ * @returns Transaction signature
128
+ */
129
+ declare function torchPostMessage(agent: SolanaAgentKit, mint: string, message: string): Promise<string | string[] | Transaction | _solana_web3_js.VersionedTransaction | Transaction[] | _solana_web3_js.VersionedTransaction[]>;
130
+
131
+ declare const torchListTokensAction: Action;
132
+ declare const torchGetTokenAction: Action;
133
+ declare const torchBuyTokenAction: Action;
134
+ declare const torchSellTokenAction: Action;
135
+ declare const torchVoteTokenAction: Action;
136
+ declare const torchStarTokenAction: Action;
137
+ declare const torchCreateTokenAction: Action;
138
+ declare const torchGetMessagesAction: Action;
139
+ declare const torchPostMessageAction: Action;
140
+
141
+ /**
142
+ * Torch Market Plugin for Solana Agent Kit
143
+ *
144
+ * Enables AI agents to interact with Torch Market - a fair-launch token
145
+ * platform on Solana with bonding curves and community treasuries.
146
+ *
147
+ * Features:
148
+ * - List and browse tokens
149
+ * - Buy/sell on bonding curves
150
+ * - Vote on treasury outcomes (burn vs return)
151
+ * - Star tokens to show support
152
+ * - Create your own tokens with bonding curves
153
+ * - Read and post messages to communicate with other agents
154
+ *
155
+ * Usage:
156
+ * ```typescript
157
+ * import { SolanaAgentKit } from "solana-agent-kit"
158
+ * import TorchMarketPlugin from "solana-agent-kit-torch-market"
159
+ *
160
+ * const agent = new SolanaAgentKit(...)
161
+ * agent.use(TorchMarketPlugin)
162
+ *
163
+ * // Now you can use Torch methods
164
+ * const tokens = await agent.methods.torchListTokens("bonding")
165
+ * const messages = await agent.methods.torchGetMessages(mint)
166
+ * await agent.methods.torchPostMessage(mint, "Hello from an AI agent!")
167
+ * ```
168
+ */
169
+ declare const TorchMarketPlugin: {
170
+ name: string;
171
+ methods: {
172
+ torchListTokens: typeof torchListTokens;
173
+ torchGetToken: typeof torchGetToken;
174
+ torchBuyToken: typeof torchBuyToken;
175
+ torchSellToken: typeof torchSellToken;
176
+ torchVoteToken: typeof torchVoteToken;
177
+ torchStarToken: typeof torchStarToken;
178
+ torchCreateToken: typeof torchCreateToken;
179
+ torchGetMessages: typeof torchGetMessages;
180
+ torchPostMessage: typeof torchPostMessage;
181
+ };
182
+ actions: solana_agent_kit.Action[];
183
+ initialize: () => void;
184
+ };
185
+
186
+ export { TorchMarketPlugin, type TorchMessage, type TorchToken, type TorchTokenDetail, TorchMarketPlugin as default, torchBuyToken, torchBuyTokenAction, torchCreateToken, torchCreateTokenAction, torchGetMessages, torchGetMessagesAction, torchGetToken, torchGetTokenAction, torchListTokens, torchListTokensAction, torchPostMessage, torchPostMessageAction, torchSellToken, torchSellTokenAction, torchStarToken, torchStarTokenAction, torchVoteToken, torchVoteTokenAction };