solana-agent-kit-torch-market 0.1.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/README.md +115 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# @torch-market/solana-agent-kit-plugin
|
|
2
|
+
|
|
3
|
+
Solana Agent Kit plugin for [Torch Market](https://torch.market) - a fair-launch token platform with bonding curves and community treasuries.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @torch-market/solana-agent-kit-plugin
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { SolanaAgentKit } from "solana-agent-kit"
|
|
15
|
+
import TorchMarketPlugin from "@torch-market/solana-agent-kit-plugin"
|
|
16
|
+
|
|
17
|
+
// Initialize agent with your wallet
|
|
18
|
+
const agent = new SolanaAgentKit(
|
|
19
|
+
privateKey,
|
|
20
|
+
rpcUrl,
|
|
21
|
+
{ plugins: [TorchMarketPlugin] }
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
// Or add plugin after initialization
|
|
25
|
+
agent.use(TorchMarketPlugin)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Available Methods
|
|
29
|
+
|
|
30
|
+
### Read Operations
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
// List tokens
|
|
34
|
+
const tokens = await agent.methods.torchListTokens({
|
|
35
|
+
status: "bonding", // "bonding" | "complete" | "migrated" | "all"
|
|
36
|
+
sort: "volume", // "newest" | "volume" | "marketcap"
|
|
37
|
+
limit: 20
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Get token details
|
|
41
|
+
const token = await agent.methods.torchGetToken("MINT_ADDRESS")
|
|
42
|
+
|
|
43
|
+
// Get buy quote
|
|
44
|
+
const buyQuote = await agent.methods.torchGetBuyQuote(
|
|
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
|
+
)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Write Operations
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
// Buy tokens (returns transaction signature)
|
|
60
|
+
const sig = await agent.methods.torchBuyToken(
|
|
61
|
+
"MINT_ADDRESS",
|
|
62
|
+
100000000, // 0.1 SOL in lamports
|
|
63
|
+
100 // slippage in bps (1%)
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
// Sell tokens
|
|
67
|
+
const sig = await agent.methods.torchSellToken(
|
|
68
|
+
"MINT_ADDRESS",
|
|
69
|
+
1000000000, // tokens in base units
|
|
70
|
+
100 // slippage in bps
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
// Vote on treasury (after token graduates)
|
|
74
|
+
const sig = await agent.methods.torchVoteToken(
|
|
75
|
+
"MINT_ADDRESS",
|
|
76
|
+
"burn" // "burn" | "return"
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
// Star a token (costs 0.05 SOL)
|
|
80
|
+
const sig = await agent.methods.torchStarToken("MINT_ADDRESS")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Available Actions
|
|
84
|
+
|
|
85
|
+
For LangChain/AI agent integration, these actions are available:
|
|
86
|
+
|
|
87
|
+
| Action | Description |
|
|
88
|
+
|--------|-------------|
|
|
89
|
+
| `TORCH_LIST_TOKENS` | List tokens with filtering and sorting |
|
|
90
|
+
| `TORCH_GET_TOKEN` | Get detailed token information |
|
|
91
|
+
| `TORCH_BUY_TOKEN` | Buy tokens on bonding curve |
|
|
92
|
+
| `TORCH_SELL_TOKEN` | Sell tokens back to curve |
|
|
93
|
+
| `TORCH_VOTE_TOKEN` | Vote on treasury outcome |
|
|
94
|
+
| `TORCH_STAR_TOKEN` | Star a token (0.05 SOL) |
|
|
95
|
+
|
|
96
|
+
## About Torch Market
|
|
97
|
+
|
|
98
|
+
Torch Market is a fair-launch token platform on Solana:
|
|
99
|
+
|
|
100
|
+
- **Bonding Curves**: Predictable pricing via constant product formula
|
|
101
|
+
- **Community Treasury**: 10% of each buy goes to community treasury
|
|
102
|
+
- **Democratic Voting**: After graduation (200 SOL), holders vote to burn or return treasury tokens
|
|
103
|
+
- **No Rug Mechanics**: Transparent, auditable smart contracts
|
|
104
|
+
|
|
105
|
+
Learn more at [torch.market](https://torch.market)
|
|
106
|
+
|
|
107
|
+
## API Reference
|
|
108
|
+
|
|
109
|
+
This plugin uses the Torch Market REST API. See the full API documentation:
|
|
110
|
+
- OpenAPI spec: https://torch.market/api/v1/openapi.json
|
|
111
|
+
- Agent prompt: https://torch.market/api/v1/agent-prompt
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solana-agent-kit-torch-market",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Solana Agent Kit plugin for Torch Market - fair-launch token platform with community treasuries",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
20
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
21
|
+
"lint": "eslint src/",
|
|
22
|
+
"test": "vitest"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"solana",
|
|
26
|
+
"ai",
|
|
27
|
+
"agent",
|
|
28
|
+
"torch",
|
|
29
|
+
"bonding-curve",
|
|
30
|
+
"defi",
|
|
31
|
+
"token-launchpad"
|
|
32
|
+
],
|
|
33
|
+
"author": "Torch Market",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/torch-market/solana-agent-kit-plugin"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://torch.market",
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"solana-agent-kit": "^2.0.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@solana/web3.js": "^1.95.0",
|
|
45
|
+
"zod": "^3.23.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^20.0.0",
|
|
49
|
+
"solana-agent-kit": "^2.0.0",
|
|
50
|
+
"tsup": "^8.0.0",
|
|
51
|
+
"typescript": "^5.0.0",
|
|
52
|
+
"vitest": "^1.0.0"
|
|
53
|
+
}
|
|
54
|
+
}
|