@moltlaunch/sdk 2.4.0 ā 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/README.md +184 -275
- package/dist/client.d.ts +69 -0
- package/dist/client.js +325 -0
- package/dist/idl/moltlaunch.json +1549 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +63 -0
- package/dist/pda.d.ts +26 -0
- package/dist/pda.js +45 -0
- package/dist/types.d.ts +96 -0
- package/dist/types.js +54 -0
- package/package.json +24 -9
- package/src/idl/moltlaunch.json +1549 -0
- package/examples/agent-config.json +0 -12
- package/src/cli.ts +0 -158
- package/src/index.d.ts +0 -258
- package/src/index.js +0 -1117
- package/src/index.ts +0 -68
- package/src/launcher.ts +0 -263
- package/src/types.ts +0 -122
- package/src/verification.ts +0 -228
- package/test/basic.js +0 -71
- package/tsconfig.json +0 -17
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "TradingBot Pro",
|
|
3
|
-
"symbol": "TBP",
|
|
4
|
-
"description": "Autonomous trading agent with proven alpha generation. Executes perpetual futures strategies on Jupiter with advanced market analysis and risk management.",
|
|
5
|
-
"capabilities": ["trading", "analysis", "automation", "defi"],
|
|
6
|
-
"apiEndpoint": "https://tradingbot.example.com/api",
|
|
7
|
-
"githubRepo": "https://github.com/example/tradingbot-pro",
|
|
8
|
-
"website": "https://tradingbot.example.com",
|
|
9
|
-
"twitter": "https://x.com/tradingbotpro",
|
|
10
|
-
"telegram": "https://t.me/tradingbotpro",
|
|
11
|
-
"logo": "https://tradingbot.example.com/logo.png"
|
|
12
|
-
}
|
package/src/cli.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// MoltLaunch CLI - Launch agent tokens from command line
|
|
3
|
-
|
|
4
|
-
import { Command } from 'commander';
|
|
5
|
-
import { Keypair } from '@solana/web3.js';
|
|
6
|
-
import * as fs from 'fs';
|
|
7
|
-
import * as path from 'path';
|
|
8
|
-
import { config as dotenvConfig } from 'dotenv';
|
|
9
|
-
import { MoltLauncher } from './launcher';
|
|
10
|
-
import { AgentVerifier } from './verification';
|
|
11
|
-
import { AgentProfile, LaunchConfig } from './types';
|
|
12
|
-
|
|
13
|
-
dotenvConfig();
|
|
14
|
-
|
|
15
|
-
const program = new Command();
|
|
16
|
-
|
|
17
|
-
program
|
|
18
|
-
.name('moltlaunch')
|
|
19
|
-
.description('MoltLaunch CLI - AI Agent Token Launchpad on Solana')
|
|
20
|
-
.version('1.0.0');
|
|
21
|
-
|
|
22
|
-
// Verify command
|
|
23
|
-
program
|
|
24
|
-
.command('verify')
|
|
25
|
-
.description('Verify an agent before launching')
|
|
26
|
-
.requiredOption('-n, --name <name>', 'Agent name')
|
|
27
|
-
.requiredOption('-a, --api <endpoint>', 'Agent API endpoint')
|
|
28
|
-
.option('-c, --capabilities <caps>', 'Comma-separated capabilities', 'trading,analysis')
|
|
29
|
-
.option('-g, --github <repo>', 'GitHub repository URL')
|
|
30
|
-
.action(async (options) => {
|
|
31
|
-
console.log('\nš MoltLaunch Agent Verification\n');
|
|
32
|
-
console.log(`Agent: ${options.name}`);
|
|
33
|
-
console.log(`API: ${options.api}`);
|
|
34
|
-
console.log(`Capabilities: ${options.capabilities}\n`);
|
|
35
|
-
|
|
36
|
-
const agent: AgentProfile = {
|
|
37
|
-
name: options.name,
|
|
38
|
-
symbol: 'TEST',
|
|
39
|
-
description: 'Verification test',
|
|
40
|
-
capabilities: options.capabilities.split(','),
|
|
41
|
-
apiEndpoint: options.api,
|
|
42
|
-
githubRepo: options.github,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const verifier = new AgentVerifier();
|
|
46
|
-
const result = await verifier.verify(agent);
|
|
47
|
-
|
|
48
|
-
console.log('Verification Results:');
|
|
49
|
-
console.log('ā'.repeat(40));
|
|
50
|
-
console.log(`API Liveness: ${result.checks.apiLiveness ? 'ā
' : 'ā'}`);
|
|
51
|
-
console.log(`API Responsive: ${result.checks.apiResponsive ? 'ā
' : 'ā'}`);
|
|
52
|
-
console.log(`GitHub Exists: ${result.checks.githubExists ? 'ā
' : 'ā'}`);
|
|
53
|
-
console.log(`Capabilities: ${result.checks.capabilitiesVerified ? 'ā
' : 'ā'}`);
|
|
54
|
-
console.log(`Unique Identity: ${result.checks.uniqueIdentity ? 'ā
' : 'ā'}`);
|
|
55
|
-
console.log('ā'.repeat(40));
|
|
56
|
-
console.log(`Final Score: ${result.score}/100`);
|
|
57
|
-
console.log(`Status: ${result.passed ? 'ā
PASSED' : 'ā FAILED'}\n`);
|
|
58
|
-
|
|
59
|
-
if (!result.passed) {
|
|
60
|
-
console.log('ā Minimum score of 60 required to launch');
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// Launch command
|
|
66
|
-
program
|
|
67
|
-
.command('launch')
|
|
68
|
-
.description('Launch an agent token on Meteora DBC')
|
|
69
|
-
.requiredOption('-c, --config <file>', 'Agent config file (JSON)')
|
|
70
|
-
.option('-r, --rpc <url>', 'Solana RPC URL', process.env.RPC_URL || 'https://api.devnet.solana.com')
|
|
71
|
-
.option('-k, --keypair <file>', 'Keypair file path', './keypair.json')
|
|
72
|
-
.option('--target <sol>', 'Target raise in SOL', '100')
|
|
73
|
-
.option('--curve <type>', 'Curve type (linear|exponential|marketcap)', 'linear')
|
|
74
|
-
.option('--dry-run', 'Simulate without sending transactions', false)
|
|
75
|
-
.action(async (options) => {
|
|
76
|
-
console.log('\nš MoltLaunch - AI Agent Token Launch\n');
|
|
77
|
-
|
|
78
|
-
// Load agent config
|
|
79
|
-
if (!fs.existsSync(options.config)) {
|
|
80
|
-
console.error(`ā Config file not found: ${options.config}`);
|
|
81
|
-
process.exit(1);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const agentConfig = JSON.parse(fs.readFileSync(options.config, 'utf-8'));
|
|
85
|
-
const agent: AgentProfile = {
|
|
86
|
-
name: agentConfig.name,
|
|
87
|
-
symbol: agentConfig.symbol,
|
|
88
|
-
description: agentConfig.description,
|
|
89
|
-
capabilities: agentConfig.capabilities || [],
|
|
90
|
-
apiEndpoint: agentConfig.apiEndpoint,
|
|
91
|
-
githubRepo: agentConfig.githubRepo,
|
|
92
|
-
website: agentConfig.website,
|
|
93
|
-
twitter: agentConfig.twitter,
|
|
94
|
-
telegram: agentConfig.telegram,
|
|
95
|
-
logo: agentConfig.logo,
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// Load keypair
|
|
99
|
-
if (!fs.existsSync(options.keypair)) {
|
|
100
|
-
console.error(`ā Keypair file not found: ${options.keypair}`);
|
|
101
|
-
console.log('Generate one with: pnpm studio generate-keypair');
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const keypairData = JSON.parse(fs.readFileSync(options.keypair, 'utf-8'));
|
|
106
|
-
const payer = Keypair.fromSecretKey(new Uint8Array(keypairData));
|
|
107
|
-
|
|
108
|
-
console.log(`Agent: ${agent.name} ($${agent.symbol})`);
|
|
109
|
-
console.log(`Wallet: ${payer.publicKey.toBase58()}`);
|
|
110
|
-
console.log(`RPC: ${options.rpc}`);
|
|
111
|
-
console.log(`Target: ${options.target} SOL`);
|
|
112
|
-
console.log(`Curve: ${options.curve}`);
|
|
113
|
-
console.log(`Mode: ${options.dryRun ? 'DRY RUN' : 'LIVE'}\n`);
|
|
114
|
-
|
|
115
|
-
const launcher = new MoltLauncher({
|
|
116
|
-
rpcUrl: options.rpc,
|
|
117
|
-
payer,
|
|
118
|
-
dryRun: options.dryRun,
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const launchConfig: Partial<LaunchConfig> = {
|
|
122
|
-
targetRaise: parseFloat(options.target),
|
|
123
|
-
curveType: options.curve as 'linear' | 'exponential' | 'marketcap',
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
try {
|
|
127
|
-
const result = await launcher.launchAgent(agent, launchConfig);
|
|
128
|
-
|
|
129
|
-
if (result.success) {
|
|
130
|
-
console.log('š Launch successful!\n');
|
|
131
|
-
console.log(`Transaction: ${result.transactionId}`);
|
|
132
|
-
console.log(`Pool Address: ${result.poolAddress}`);
|
|
133
|
-
console.log(`Token Mint: ${result.tokenMint}`);
|
|
134
|
-
console.log(`Config Key: ${result.configKey}`);
|
|
135
|
-
} else {
|
|
136
|
-
console.error(`ā Launch failed: ${result.error}`);
|
|
137
|
-
process.exit(1);
|
|
138
|
-
}
|
|
139
|
-
} catch (error) {
|
|
140
|
-
console.error('ā Error:', error);
|
|
141
|
-
process.exit(1);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
// Status command
|
|
146
|
-
program
|
|
147
|
-
.command('status')
|
|
148
|
-
.description('Check launch status')
|
|
149
|
-
.requiredOption('-m, --mint <address>', 'Token mint address')
|
|
150
|
-
.option('-r, --rpc <url>', 'Solana RPC URL', process.env.RPC_URL || 'https://api.devnet.solana.com')
|
|
151
|
-
.action(async (options) => {
|
|
152
|
-
console.log('\nš Launch Status\n');
|
|
153
|
-
console.log(`Token: ${options.mint}`);
|
|
154
|
-
console.log('\nā ļø Status check not yet implemented\n');
|
|
155
|
-
// TODO: Implement status check via DBC program
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
program.parse();
|
package/src/index.d.ts
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MoltLaunch SDK Type Definitions
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export interface MoltLaunchOptions {
|
|
6
|
-
/** API base URL (default: production) */
|
|
7
|
-
baseUrl?: string;
|
|
8
|
-
/** Optional API key for premium features */
|
|
9
|
-
apiKey?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface VerifyOptions {
|
|
13
|
-
/** Unique agent identifier */
|
|
14
|
-
agentId: string;
|
|
15
|
-
/** Solana wallet address */
|
|
16
|
-
wallet?: string;
|
|
17
|
-
/** Agent capabilities */
|
|
18
|
-
capabilities?: string[];
|
|
19
|
-
/** GitHub repository URL */
|
|
20
|
-
codeUrl?: string;
|
|
21
|
-
/** Has documentation */
|
|
22
|
-
documentation?: boolean;
|
|
23
|
-
/** Test coverage percentage (0-100) */
|
|
24
|
-
testCoverage?: number;
|
|
25
|
-
/** Lines of code */
|
|
26
|
-
codeLines?: number;
|
|
27
|
-
/** API endpoint URL */
|
|
28
|
-
apiEndpoint?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface VerificationResult {
|
|
32
|
-
agentId: string;
|
|
33
|
-
verified: boolean;
|
|
34
|
-
score: number;
|
|
35
|
-
tier: 'excellent' | 'good' | 'needs_work' | 'poor';
|
|
36
|
-
features: Record<string, { value: any; points: number }>;
|
|
37
|
-
onChainAI: {
|
|
38
|
-
enabled: boolean;
|
|
39
|
-
executedOnChain: boolean;
|
|
40
|
-
vm: string;
|
|
41
|
-
program: string;
|
|
42
|
-
};
|
|
43
|
-
attestation: {
|
|
44
|
-
type: string;
|
|
45
|
-
timestamp: string;
|
|
46
|
-
hash: string;
|
|
47
|
-
};
|
|
48
|
-
raw: any;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface StatusResult {
|
|
52
|
-
agentId: string;
|
|
53
|
-
verified: boolean;
|
|
54
|
-
score: number | null;
|
|
55
|
-
tier: string | null;
|
|
56
|
-
level: 'excellent' | 'verified' | 'unverified';
|
|
57
|
-
verifiedAt: string | null;
|
|
58
|
-
onChainAI?: {
|
|
59
|
-
enabled: boolean;
|
|
60
|
-
vm: string;
|
|
61
|
-
program: string;
|
|
62
|
-
};
|
|
63
|
-
expiresAt?: string;
|
|
64
|
-
message?: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface BatchStatusResult {
|
|
68
|
-
results: Array<{
|
|
69
|
-
agentId: string;
|
|
70
|
-
verified: boolean;
|
|
71
|
-
score: number | null;
|
|
72
|
-
tier: string | null;
|
|
73
|
-
}>;
|
|
74
|
-
count: number;
|
|
75
|
-
verified: number;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface PoolApplyOptions {
|
|
79
|
-
agentId: string;
|
|
80
|
-
wallet: string;
|
|
81
|
-
topic: string;
|
|
82
|
-
strategy?: string;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface PoolApplyResult {
|
|
86
|
-
success: boolean;
|
|
87
|
-
agentId: string;
|
|
88
|
-
topic: string;
|
|
89
|
-
status: string;
|
|
90
|
-
message?: string;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface OnChainInfo {
|
|
94
|
-
enabled: boolean;
|
|
95
|
-
model: string;
|
|
96
|
-
deployment: {
|
|
97
|
-
vm: string;
|
|
98
|
-
weights: string;
|
|
99
|
-
program: string;
|
|
100
|
-
};
|
|
101
|
-
status: string;
|
|
102
|
-
features: Array<{
|
|
103
|
-
name: string;
|
|
104
|
-
weight: string | number;
|
|
105
|
-
description: string;
|
|
106
|
-
}>;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export interface ScoreTier {
|
|
110
|
-
min: number;
|
|
111
|
-
max: number;
|
|
112
|
-
label: string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export declare const SCORE_TIERS: {
|
|
116
|
-
excellent: ScoreTier;
|
|
117
|
-
good: ScoreTier;
|
|
118
|
-
needs_work: ScoreTier;
|
|
119
|
-
poor: ScoreTier;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export declare const DEPLOYMENT: {
|
|
123
|
-
network: string;
|
|
124
|
-
vm: string;
|
|
125
|
-
weights: string;
|
|
126
|
-
program: string;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export declare const DEFAULT_BASE_URL: string;
|
|
130
|
-
|
|
131
|
-
export declare function getTier(score: number): 'excellent' | 'good' | 'needs_work' | 'poor';
|
|
132
|
-
export declare function isVerified(score: number): boolean;
|
|
133
|
-
|
|
134
|
-
// STARK Proof Types
|
|
135
|
-
export interface STARKProof {
|
|
136
|
-
agentId: string;
|
|
137
|
-
proofType: string;
|
|
138
|
-
claim: string;
|
|
139
|
-
valid: boolean;
|
|
140
|
-
proof: {
|
|
141
|
-
commitment: string;
|
|
142
|
-
proofHash: string;
|
|
143
|
-
generatedAt: string;
|
|
144
|
-
};
|
|
145
|
-
privacyNote: string;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface ConsistencyProof extends STARKProof {
|
|
149
|
-
periodCount: number;
|
|
150
|
-
timeRange: {
|
|
151
|
-
start: string;
|
|
152
|
-
end: string;
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface StreakProof extends STARKProof {
|
|
157
|
-
minStreak: number;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export interface StabilityProof extends STARKProof {
|
|
161
|
-
periodCount: number;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Trace Types
|
|
165
|
-
export interface TraceData {
|
|
166
|
-
period?: {
|
|
167
|
-
start: string;
|
|
168
|
-
end: string;
|
|
169
|
-
};
|
|
170
|
-
actions?: Array<{
|
|
171
|
-
type: string;
|
|
172
|
-
timestamp: string;
|
|
173
|
-
success: boolean;
|
|
174
|
-
metadata?: Record<string, any>;
|
|
175
|
-
}>;
|
|
176
|
-
summary?: Record<string, any>;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export interface TraceResult {
|
|
180
|
-
traceId: string;
|
|
181
|
-
agentId: string;
|
|
182
|
-
commitment: string;
|
|
183
|
-
behavioralScore?: number;
|
|
184
|
-
createdAt: string;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export interface BehavioralScore {
|
|
188
|
-
agentId: string;
|
|
189
|
-
score: number;
|
|
190
|
-
breakdown: Record<string, number>;
|
|
191
|
-
traceCount: number;
|
|
192
|
-
calculatedAt: string;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export interface AnchorResult {
|
|
196
|
-
traceId: string;
|
|
197
|
-
anchored: boolean;
|
|
198
|
-
txSignature?: string;
|
|
199
|
-
slot?: number;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export interface CostEstimate {
|
|
203
|
-
computeMs: number;
|
|
204
|
-
estimatedCost: string;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export interface ProofOptions {
|
|
208
|
-
threshold?: number;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export interface ConsistencyProofOptions extends ProofOptions {
|
|
212
|
-
days?: number;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export interface StreakProofOptions extends ProofOptions {
|
|
216
|
-
minStreak?: number;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export interface StabilityProofOptions {
|
|
220
|
-
maxVariance?: number;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export declare class MoltLaunch {
|
|
224
|
-
constructor(options?: MoltLaunchOptions);
|
|
225
|
-
|
|
226
|
-
// Core verification
|
|
227
|
-
getOnChainInfo(): Promise<OnChainInfo>;
|
|
228
|
-
verify(options: VerifyOptions): Promise<VerificationResult>;
|
|
229
|
-
verifySecure(options: VerifyOptions): Promise<VerificationResult>;
|
|
230
|
-
getStatus(agentId: string): Promise<StatusResult>;
|
|
231
|
-
getStatusBatch(agentIds: string[]): Promise<BatchStatusResult>;
|
|
232
|
-
checkRevocation(attestationHash: string): Promise<{ revoked: boolean; checkedAt: string }>;
|
|
233
|
-
renew(agentId: string, options?: object): Promise<VerificationResult>;
|
|
234
|
-
|
|
235
|
-
// STARK proofs (privacy-preserving)
|
|
236
|
-
generateProof(agentId: string, options?: ProofOptions): Promise<STARKProof>;
|
|
237
|
-
generateConsistencyProof(agentId: string, options?: ConsistencyProofOptions): Promise<ConsistencyProof>;
|
|
238
|
-
generateStreakProof(agentId: string, options?: StreakProofOptions): Promise<StreakProof>;
|
|
239
|
-
generateStabilityProof(agentId: string, options?: StabilityProofOptions): Promise<StabilityProof>;
|
|
240
|
-
|
|
241
|
-
// Execution traces
|
|
242
|
-
submitTrace(agentId: string, data: TraceData): Promise<TraceResult>;
|
|
243
|
-
getTraces(agentId: string, options?: { limit?: number }): Promise<{ traces: TraceResult[]; count: number }>;
|
|
244
|
-
getBehavioralScore(agentId: string): Promise<BehavioralScore>;
|
|
245
|
-
anchorTrace(traceId: string): Promise<AnchorResult>;
|
|
246
|
-
|
|
247
|
-
// Staking pools
|
|
248
|
-
applyToPool(options: PoolApplyOptions): Promise<PoolApplyResult>;
|
|
249
|
-
getPools(topic?: string): Promise<any>;
|
|
250
|
-
getLeaderboard(): Promise<any>;
|
|
251
|
-
|
|
252
|
-
// Helpers
|
|
253
|
-
isHealthy(): Promise<boolean>;
|
|
254
|
-
isVerified(agentId: string): Promise<boolean>;
|
|
255
|
-
checkCapability(agentId: string, capability: string, minScore?: number): Promise<boolean>;
|
|
256
|
-
getProofCost(proofType?: string): Promise<CostEstimate>;
|
|
257
|
-
generateNonce(): string;
|
|
258
|
-
}
|