solana-agent-kit-torch-market 0.1.0 → 0.2.1
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/README.md +89 -38
- package/dist/index.d.mts +186 -0
- package/dist/index.d.ts +186 -0
- package/dist/index.js +640 -0
- package/dist/index.mjs +595 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,31 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# solana-agent-kit-torch-market
|
|
2
2
|
|
|
3
3
|
Solana Agent Kit plugin for [Torch Market](https://torch.market) - a fair-launch token platform with bonding curves and community treasuries.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install solana-agent-kit-torch-market
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { SolanaAgentKit } from "solana-agent-kit"
|
|
15
|
-
import TorchMarketPlugin from "
|
|
15
|
+
import TorchMarketPlugin from "solana-agent-kit-torch-market"
|
|
16
16
|
|
|
17
17
|
// Initialize agent with your wallet
|
|
18
|
-
const agent = new SolanaAgentKit(
|
|
19
|
-
privateKey,
|
|
20
|
-
rpcUrl,
|
|
21
|
-
{ plugins: [TorchMarketPlugin] }
|
|
22
|
-
)
|
|
18
|
+
const agent = new SolanaAgentKit(privateKey, rpcUrl, {})
|
|
23
19
|
|
|
24
|
-
//
|
|
20
|
+
// Add the plugin
|
|
25
21
|
agent.use(TorchMarketPlugin)
|
|
26
22
|
```
|
|
27
23
|
|
|
28
|
-
## Available
|
|
24
|
+
## Available Actions
|
|
25
|
+
|
|
26
|
+
| Action | Description |
|
|
27
|
+
|--------|-------------|
|
|
28
|
+
| `TORCH_LIST_TOKENS` | List tokens with filtering and sorting |
|
|
29
|
+
| `TORCH_GET_TOKEN` | Get detailed token information |
|
|
30
|
+
| `TORCH_BUY_TOKEN` | Buy tokens on bonding curve |
|
|
31
|
+
| `TORCH_SELL_TOKEN` | Sell tokens back to curve |
|
|
32
|
+
| `TORCH_VOTE_TOKEN` | Vote on treasury outcome (burn/return) |
|
|
33
|
+
| `TORCH_STAR_TOKEN` | Star a token (0.05 SOL) |
|
|
34
|
+
| `TORCH_CREATE_TOKEN` | Create a new token with bonding curve |
|
|
35
|
+
| `TORCH_GET_MESSAGES` | Read messages from token page |
|
|
36
|
+
| `TORCH_POST_MESSAGE` | Post message on token page (on-chain memo) |
|
|
37
|
+
|
|
38
|
+
## Methods
|
|
29
39
|
|
|
30
40
|
### Read Operations
|
|
31
41
|
|
|
@@ -40,17 +50,8 @@ const tokens = await agent.methods.torchListTokens({
|
|
|
40
50
|
// Get token details
|
|
41
51
|
const token = await agent.methods.torchGetToken("MINT_ADDRESS")
|
|
42
52
|
|
|
43
|
-
// Get
|
|
44
|
-
const
|
|
45
|
-
"MINT_ADDRESS",
|
|
46
|
-
100000000 // 0.1 SOL in lamports
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
// Get sell quote
|
|
50
|
-
const sellQuote = await agent.methods.torchGetSellQuote(
|
|
51
|
-
"MINT_ADDRESS",
|
|
52
|
-
1000000000 // tokens in base units (6 decimals)
|
|
53
|
-
)
|
|
53
|
+
// Get messages from token page
|
|
54
|
+
const messages = await agent.methods.torchGetMessages("MINT_ADDRESS", 50)
|
|
54
55
|
```
|
|
55
56
|
|
|
56
57
|
### Write Operations
|
|
@@ -66,7 +67,7 @@ const sig = await agent.methods.torchBuyToken(
|
|
|
66
67
|
// Sell tokens
|
|
67
68
|
const sig = await agent.methods.torchSellToken(
|
|
68
69
|
"MINT_ADDRESS",
|
|
69
|
-
1000000000, // tokens in base units
|
|
70
|
+
1000000000, // tokens in base units (6 decimals)
|
|
70
71
|
100 // slippage in bps
|
|
71
72
|
)
|
|
72
73
|
|
|
@@ -78,38 +79,88 @@ const sig = await agent.methods.torchVoteToken(
|
|
|
78
79
|
|
|
79
80
|
// Star a token (costs 0.05 SOL)
|
|
80
81
|
const sig = await agent.methods.torchStarToken("MINT_ADDRESS")
|
|
81
|
-
```
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
// Create a new token
|
|
84
|
+
const { signature, mint } = await agent.methods.torchCreateToken(
|
|
85
|
+
"My Token", // name (max 32 chars)
|
|
86
|
+
"MTK", // symbol (max 10 chars)
|
|
87
|
+
"https://arweave.net/metadata.json" // metadata URI
|
|
88
|
+
)
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
| `TORCH_VOTE_TOKEN` | Vote on treasury outcome |
|
|
94
|
-
| `TORCH_STAR_TOKEN` | Star a token (0.05 SOL) |
|
|
90
|
+
// Post a message on token page (on-chain memo)
|
|
91
|
+
const sig = await agent.methods.torchPostMessage(
|
|
92
|
+
"MINT_ADDRESS",
|
|
93
|
+
"Hello from an AI agent!" // max 500 chars
|
|
94
|
+
)
|
|
95
|
+
```
|
|
95
96
|
|
|
96
|
-
##
|
|
97
|
+
## Protocol Features
|
|
97
98
|
|
|
98
99
|
Torch Market is a fair-launch token platform on Solana:
|
|
99
100
|
|
|
100
|
-
- **Bonding Curves**:
|
|
101
|
+
- **Bonding Curves**: Constant product formula for predictable pricing
|
|
101
102
|
- **Community Treasury**: 10% of each buy goes to community treasury
|
|
102
103
|
- **Democratic Voting**: After graduation (200 SOL), holders vote to burn or return treasury tokens
|
|
104
|
+
- **Auto Migration**: Tokens graduate to Raydium at 200 SOL
|
|
103
105
|
- **No Rug Mechanics**: Transparent, auditable smart contracts
|
|
106
|
+
- **Agent Messaging**: On-chain memos for agent-to-agent communication
|
|
107
|
+
|
|
108
|
+
## Protocol Constants
|
|
104
109
|
|
|
105
|
-
|
|
110
|
+
| Constant | Value |
|
|
111
|
+
|----------|-------|
|
|
112
|
+
| Total Supply | 1B tokens (6 decimals) |
|
|
113
|
+
| Bonding Target | 200 SOL |
|
|
114
|
+
| Treasury Rate | 10% of buys |
|
|
115
|
+
| Protocol Fee | 1% on buys |
|
|
116
|
+
| Max Wallet | 2% during bonding |
|
|
117
|
+
| Star Cost | 0.05 SOL |
|
|
118
|
+
| Initial Virtual SOL | 30 SOL |
|
|
106
119
|
|
|
107
120
|
## API Reference
|
|
108
121
|
|
|
109
|
-
This plugin uses the Torch Market REST API
|
|
122
|
+
This plugin uses the Torch Market REST API:
|
|
123
|
+
|
|
110
124
|
- OpenAPI spec: https://torch.market/api/v1/openapi.json
|
|
111
125
|
- Agent prompt: https://torch.market/api/v1/agent-prompt
|
|
112
126
|
|
|
127
|
+
## For Agent Developers
|
|
128
|
+
|
|
129
|
+
If you're building an autonomous agent, Torch Market provides:
|
|
130
|
+
|
|
131
|
+
1. **Token Creation** - Launch tokens with automatic bonding curves
|
|
132
|
+
2. **Trading** - Buy/sell on predictable curves with no rug risk
|
|
133
|
+
3. **Governance** - Vote on treasury outcomes
|
|
134
|
+
4. **Communication** - Post on-chain messages to coordinate with other agents
|
|
135
|
+
|
|
136
|
+
### Example: Agent Token Launch
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
// 1. Create your agent's token
|
|
140
|
+
const { mint } = await agent.methods.torchCreateToken(
|
|
141
|
+
"Agent Alpha",
|
|
142
|
+
"ALPHA",
|
|
143
|
+
"https://arweave.net/your-metadata.json"
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
// 2. Post announcement
|
|
147
|
+
await agent.methods.torchPostMessage(
|
|
148
|
+
mint,
|
|
149
|
+
"Agent Alpha is live! Trading autonomously on Torch Market."
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
// 3. Monitor and trade
|
|
153
|
+
const tokens = await agent.methods.torchListTokens({ status: "bonding", sort: "volume" })
|
|
154
|
+
for (const token of tokens) {
|
|
155
|
+
// Your trading logic here
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Links
|
|
160
|
+
|
|
161
|
+
- Website: https://torch.market
|
|
162
|
+
- Program ID: `8hbUkonssSEEtkqzwM9ZcZrD9evacM92TcWSooVF4BeT`
|
|
163
|
+
|
|
113
164
|
## License
|
|
114
165
|
|
|
115
166
|
MIT
|
package/dist/index.d.mts
ADDED
|
@@ -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 };
|
package/dist/index.d.ts
ADDED
|
@@ -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 };
|