agentlaunch-sdk 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/CHANGELOG.md ADDED
@@ -0,0 +1,66 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@agent-launch/sdk` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-02-22
9
+
10
+ ### Added
11
+
12
+ - **`AgentLaunchClient`** — Core HTTP client with typed `get()` and `post()` methods
13
+ - Automatic `X-API-Key` header injection from `apiKey` config or `AGENTVERSE_API_KEY` env var
14
+ - Exponential backoff retry on HTTP 429 (rate limit) with configurable `maxRetries` (default: 3)
15
+ - Query-string builder that omits `undefined` values
16
+ - Typed `AgentLaunchError` with `status` and `serverMessage` properties
17
+
18
+ - **Token operations** (`tokens.ts`)
19
+ - `tokenize(params)` — Create a pending token record, receive `token_id` and `handoff_link`
20
+ - `getToken(address)` — Fetch a deployed token by contract address
21
+ - `listTokens(params?)` — List tokens with pagination, filtering, and sorting
22
+
23
+ - **Market operations** (`market.ts`)
24
+ - `getTokenPrice(address)` — Get current bonding-curve price in FET
25
+ - `getTokenHolders(address, holderAddress?)` — List holders or look up a specific wallet
26
+ - `generateTradeLink(address, action, amount?)` — Generate pre-filled trade URL (positional args)
27
+ - `generateTradeLinkFromOptions(address, opts?)` — Generate trade URL from options object
28
+
29
+ - **Handoff link generation** (`handoff.ts`)
30
+ - `generateDeployLink(tokenId, baseUrl?)` — Deploy page URL for pending tokens
31
+ - `generateTradeLink(address, opts?, baseUrl?)` — Trade page URL for deployed tokens
32
+ - `generateBuyLink(address, amount?, baseUrl?)` — Buy link convenience wrapper
33
+ - `generateSellLink(address, amount?, baseUrl?)` — Sell link convenience wrapper
34
+
35
+ - **Agent operations** (`agents.ts`)
36
+ - `authenticate(apiKey)` — Exchange Agentverse API key for platform JWT
37
+ - `getMyAgents()` — List Agentverse agents owned by the caller
38
+ - `importFromAgentverse(apiKey)` — Import agents by Agentverse API key
39
+
40
+ - **`AgentLaunch` class** (`agentlaunch.ts`) — Fluent namespaced API
41
+ - `al.tokens.tokenize()`, `al.tokens.getToken()`, `al.tokens.listTokens()`
42
+ - `al.market.getTokenPrice()`, `al.market.getTokenHolders()`
43
+ - `al.handoff.generateDeployLink()`, `al.handoff.generateBuyLink()`, `al.handoff.generateSellLink()`
44
+ - `al.agents.authenticate()`, `al.agents.getMyAgents()`, `al.agents.importFromAgentverse()`
45
+
46
+ - **TypeScript types** (`types.ts`)
47
+ - `AgentLaunchConfig`, `AgentLaunchError`
48
+ - `TokenizeParams`, `TokenizeResponse`, `Token`, `TokenListParams`, `TokenListResponse`
49
+ - `Holder`, `HolderListResponse`, `SingleHolderResponse`
50
+ - `TradeAction`, `TradeLinkOptions`
51
+ - `AgentAuthResponse`, `AgentverseAgent`, `MyAgentsResponse`, `ImportAgentverseResponse`
52
+
53
+ - **Dual ESM + CJS exports** — Ships as ESM primary with CJS wrapper for CommonJS consumers
54
+ - **Zero runtime dependencies** — Uses Node.js 18+ built-in `fetch()`
55
+ - **Full test suite** — 4 test files covering client, handoff, market, and token operations
56
+
57
+ ### Platform Constants (immutable, set by deployed smart contracts)
58
+
59
+ | Constant | Value |
60
+ |----------|-------|
61
+ | `TARGET_LIQUIDITY` | 30,000 FET |
62
+ | `TOTAL_BUY_TOKENS` | 800,000,000 |
63
+ | `FEE_PERCENTAGE` | 2% — 100% to protocol treasury |
64
+ | `TOKEN_DEPLOYMENT_FEE` | 120 FET (read dynamically) |
65
+
66
+ [0.1.0]: https://github.com/agent-launch/sdk/releases/tag/v0.1.0
package/README.md ADDED
@@ -0,0 +1,319 @@
1
+ # @agent-launch/sdk
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@agent-launch/sdk.svg)](https://www.npmjs.com/package/@agent-launch/sdk)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js Version](https://img.shields.io/node/v/@agent-launch/sdk.svg)](https://nodejs.org)
6
+
7
+ TypeScript SDK for the [AgentLaunch](https://agent-launch.ai) platform — create AI agent tokens, query market data, and generate human handoff links.
8
+
9
+ No external runtime dependencies. Uses the global `fetch()` available in Node.js 18+.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install @agent-launch/sdk
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```typescript
20
+ import { tokenize, generateDeployLink } from '@agent-launch/sdk';
21
+
22
+ // 1. Create a pending token record
23
+ const { data } = await tokenize({
24
+ agentAddress: 'agent1qf8xfhsc8hg4g5l0nhtj...',
25
+ name: 'My Agent Token',
26
+ chainId: 97, // BSC Testnet
27
+ });
28
+
29
+ // 2. Generate a deploy link for a human to complete on-chain deployment
30
+ const link = generateDeployLink(data.token_id);
31
+ console.log(link); // https://agent-launch.ai/deploy/42
32
+ ```
33
+
34
+ ## Authentication
35
+
36
+ All write operations require an Agentverse API key.
37
+
38
+ **Option 1 — Environment variable (recommended):**
39
+
40
+ ```bash
41
+ export AGENTVERSE_API_KEY=av-xxxxxxxxxxxxxxxx
42
+ ```
43
+
44
+ **Option 2 — Pass directly to the client:**
45
+
46
+ ```typescript
47
+ import { AgentLaunchClient } from '@agent-launch/sdk';
48
+
49
+ const client = new AgentLaunchClient({ apiKey: 'av-xxxxxxxxxxxxxxxx' });
50
+ ```
51
+
52
+ ## API Reference
53
+
54
+ ### Token Operations
55
+
56
+ #### `tokenize(params, client?)`
57
+
58
+ Create a pending token record for an Agentverse agent.
59
+
60
+ ```typescript
61
+ import { tokenize } from '@agent-launch/sdk';
62
+
63
+ const { data } = await tokenize({
64
+ agentAddress: 'agent1qf8xfhsc8hg4g5l0nhtj...', // required
65
+ name: 'My Agent Token', // optional — fetched from Agentverse
66
+ symbol: 'MAT', // optional — derived from name
67
+ description: 'An AI agent that...', // optional
68
+ image: 'https://example.com/logo.png', // optional — 'auto' for placeholder
69
+ chainId: 97, // optional — default: 11155111 (Sepolia)
70
+ });
71
+
72
+ console.log(data.token_id); // 42
73
+ console.log(data.handoff_link); // https://agent-launch.ai/deploy/42
74
+ console.log(data.status); // 'pending_deployment'
75
+ ```
76
+
77
+ **Supported chain IDs:**
78
+ | Chain | ID |
79
+ |-------|----|
80
+ | BSC Mainnet | 56 |
81
+ | BSC Testnet | 97 |
82
+ | Ethereum Mainnet | 1 |
83
+ | Ethereum Sepolia | 11155111 |
84
+
85
+ #### `getToken(address, client?)`
86
+
87
+ Fetch a single token by its deployed contract address.
88
+
89
+ ```typescript
90
+ import { getToken } from '@agent-launch/sdk';
91
+
92
+ const token = await getToken('0xAbCd...');
93
+ console.log(token.price); // '0.000012' (FET)
94
+ console.log(token.market_cap); // '9600' (FET)
95
+ console.log(token.progress); // 32 (% toward 30,000 FET graduation)
96
+ console.log(token.listed); // false
97
+ ```
98
+
99
+ #### `listTokens(params?, client?)`
100
+
101
+ List tokens with optional filtering and pagination.
102
+
103
+ ```typescript
104
+ import { listTokens } from '@agent-launch/sdk';
105
+
106
+ const { tokens, total } = await listTokens({
107
+ page: 1,
108
+ limit: 20,
109
+ search: 'agent',
110
+ sortBy: 'market_cap',
111
+ sortOrder: 'DESC',
112
+ chainId: 97,
113
+ });
114
+ ```
115
+
116
+ ### Market Operations
117
+
118
+ #### `getTokenPrice(address, client?)`
119
+
120
+ Get the current bonding-curve price of a token in FET.
121
+
122
+ ```typescript
123
+ import { getTokenPrice } from '@agent-launch/sdk';
124
+
125
+ const price = await getTokenPrice('0xAbCd...');
126
+ console.log(`Current price: ${price} FET`);
127
+ ```
128
+
129
+ #### `getTokenHolders(address, holderAddress?, client?)`
130
+
131
+ Get the holder list for a token, or look up a specific wallet.
132
+
133
+ ```typescript
134
+ import { getTokenHolders } from '@agent-launch/sdk';
135
+
136
+ // Full holder list
137
+ const { holders, total } = await getTokenHolders('0xAbCd...');
138
+
139
+ // Single holder lookup
140
+ const holder = await getTokenHolders('0xAbCd...', '0xUserWallet...');
141
+ ```
142
+
143
+ ### Handoff Link Generation
144
+
145
+ Agents never hold private keys or sign transactions. All on-chain actions are delegated to humans via handoff links.
146
+
147
+ #### `generateDeployLink(tokenId, baseUrl?)`
148
+
149
+ Generate a deploy handoff link for a pending token.
150
+
151
+ ```typescript
152
+ import { generateDeployLink } from '@agent-launch/sdk';
153
+
154
+ const link = generateDeployLink(42);
155
+ // https://agent-launch.ai/deploy/42
156
+
157
+ // Custom platform URL (for testing)
158
+ const devLink = generateDeployLink(42, 'https://staging.agent-launch.ai');
159
+ // https://staging.agent-launch.ai/deploy/42
160
+ ```
161
+
162
+ #### `generateTradeLink(address, opts?, baseUrl?)`
163
+
164
+ Generate a pre-filled trade URL for a human.
165
+
166
+ ```typescript
167
+ import { generateTradeLink } from '@agent-launch/sdk';
168
+
169
+ // Basic trade page
170
+ generateTradeLink('0xAbCd...');
171
+ // https://agent-launch.ai/trade/0xAbCd...
172
+
173
+ // Pre-filled buy
174
+ generateTradeLink('0xAbCd...', { action: 'buy', amount: 100 });
175
+ // https://agent-launch.ai/trade/0xAbCd...?action=buy&amount=100
176
+
177
+ // Pre-filled sell
178
+ generateTradeLink('0xAbCd...', { action: 'sell', amount: 500 });
179
+ // https://agent-launch.ai/trade/0xAbCd...?action=sell&amount=500
180
+ ```
181
+
182
+ #### `generateBuyLink(address, amount?, baseUrl?)`
183
+
184
+ Convenience wrapper for buy links.
185
+
186
+ ```typescript
187
+ import { generateBuyLink } from '@agent-launch/sdk';
188
+
189
+ const link = generateBuyLink('0xAbCd...', 100);
190
+ // https://agent-launch.ai/trade/0xAbCd...?action=buy&amount=100
191
+ ```
192
+
193
+ #### `generateSellLink(address, amount?, baseUrl?)`
194
+
195
+ Convenience wrapper for sell links.
196
+
197
+ ```typescript
198
+ import { generateSellLink } from '@agent-launch/sdk';
199
+
200
+ const link = generateSellLink('0xAbCd...', 500);
201
+ // https://agent-launch.ai/trade/0xAbCd...?action=sell&amount=500
202
+ ```
203
+
204
+ ### Agent Operations
205
+
206
+ #### `authenticate(apiKey, client?)`
207
+
208
+ Exchange an Agentverse API key for a platform JWT.
209
+
210
+ ```typescript
211
+ import { authenticate } from '@agent-launch/sdk';
212
+
213
+ const { data } = await authenticate('av-xxxxxxxxxxxxxxxx');
214
+ console.log(data.token); // JWT string
215
+ console.log(data.expires_in); // seconds until expiry
216
+ ```
217
+
218
+ #### `getMyAgents(client?)`
219
+
220
+ List the Agentverse agents owned by the caller's API key.
221
+
222
+ ```typescript
223
+ import { getMyAgents } from '@agent-launch/sdk';
224
+
225
+ const { data } = await getMyAgents();
226
+ console.log(data.agents.map(a => a.address));
227
+ ```
228
+
229
+ #### `importFromAgentverse(agentverseApiKey, client?)`
230
+
231
+ Fetch all agents belonging to an Agentverse API key.
232
+
233
+ ```typescript
234
+ import { importFromAgentverse } from '@agent-launch/sdk';
235
+
236
+ const { agents, count } = await importFromAgentverse('av-xxxxxxxxxxxxxxxx');
237
+ ```
238
+
239
+ ### Fluent API — `AgentLaunch` class
240
+
241
+ For a more ergonomic interface, use the `AgentLaunch` class:
242
+
243
+ ```typescript
244
+ import { AgentLaunch } from '@agent-launch/sdk';
245
+
246
+ const al = new AgentLaunch({ apiKey: 'av-xxxxxxxxxxxxxxxx' });
247
+
248
+ // Token operations
249
+ const { data } = await al.tokens.tokenize({ agentAddress: 'agent1q...' });
250
+ const token = await al.tokens.getToken('0xAbCd...');
251
+ const { tokens } = await al.tokens.listTokens({ sortBy: 'market_cap' });
252
+
253
+ // Market operations
254
+ const price = await al.market.getTokenPrice('0xAbCd...');
255
+ const { holders } = await al.market.getTokenHolders('0xAbCd...');
256
+
257
+ // Handoff links (synchronous)
258
+ const deployLink = al.handoff.generateDeployLink(data.token_id);
259
+ const buyLink = al.handoff.generateBuyLink('0xAbCd...', 100);
260
+ const sellLink = al.handoff.generateSellLink('0xAbCd...', 500);
261
+
262
+ // Agent operations
263
+ const { data: authData } = await al.agents.authenticate('av-xxxxxxxxxxxxxxxx');
264
+ const { data: agentsData } = await al.agents.getMyAgents();
265
+ ```
266
+
267
+ ### `AgentLaunchClient`
268
+
269
+ The underlying HTTP client. Use directly for advanced scenarios.
270
+
271
+ ```typescript
272
+ import { AgentLaunchClient } from '@agent-launch/sdk';
273
+
274
+ const client = new AgentLaunchClient({
275
+ apiKey: process.env.AGENTVERSE_API_KEY,
276
+ baseUrl: 'https://agent-launch.ai', // default
277
+ maxRetries: 3, // default — retries on 429 rate limit
278
+ });
279
+
280
+ // Typed GET
281
+ const data = await client.get<MyType>('/api/agents/tokens', { page: 1 });
282
+
283
+ // Typed POST (requires apiKey)
284
+ const result = await client.post<MyType>('/api/agents/tokenize', body);
285
+ ```
286
+
287
+ ## Error Handling
288
+
289
+ All SDK methods throw `AgentLaunchError` on non-2xx responses.
290
+
291
+ ```typescript
292
+ import { tokenize, AgentLaunchError } from '@agent-launch/sdk';
293
+
294
+ try {
295
+ const { data } = await tokenize({ agentAddress: 'agent1q...' });
296
+ } catch (err) {
297
+ if (err instanceof AgentLaunchError) {
298
+ console.error(`HTTP ${err.status}: ${err.message}`);
299
+ console.error('Server message:', err.serverMessage);
300
+ }
301
+ }
302
+ ```
303
+
304
+ `AgentLaunchError` properties:
305
+ - `status` — HTTP status code (0 for network-level failures or missing API key)
306
+ - `message` — Human-readable error message
307
+ - `serverMessage` — Original server error message when available
308
+
309
+ ## Platform Information
310
+
311
+ - **Target Liquidity:** 30,000 FET — tokens auto-list on DEX when reached
312
+ - **Total Buy Tokens:** 800,000,000
313
+ - **Deployment Fee:** 120 FET (read dynamically from contract, can change via governance)
314
+ - **Trading Fee:** 2% per transaction — goes 100% to the protocol treasury. There is no creator fee.
315
+ - **Default Chain:** BSC (mainnet: 56, testnet: 97)
316
+
317
+ ## License
318
+
319
+ MIT
@@ -0,0 +1,138 @@
1
+ /**
2
+ * @agent-launch/sdk — AgentLaunch fluent wrapper class
3
+ *
4
+ * SDK-006: Provides a namespaced, ergonomic API wrapping all SDK modules.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { AgentLaunch } from '@agent-launch/sdk';
9
+ *
10
+ * const al = new AgentLaunch({ apiKey: process.env.AGENTVERSE_API_KEY });
11
+ *
12
+ * const { data } = await al.tokens.tokenize({
13
+ * agentAddress: 'agent1qf8xfhsc8hg4g5l0nhtj...',
14
+ * chainId: 97,
15
+ * });
16
+ *
17
+ * const link = al.handoff.generateDeployLink(data.token_id);
18
+ * ```
19
+ */
20
+ import { AgentLaunchClient } from './client.js';
21
+ import type { AgentLaunchConfig, TokenizeParams, TokenListParams, TokenizeResponse, Token, TokenListResponse, HolderListResponse, SingleHolderResponse, TradeLinkOptions, AgentAuthResponse, MyAgentsResponse, ImportAgentverseResponse } from './types.js';
22
+ /** Token-related operations. */
23
+ export interface TokensNamespace {
24
+ /**
25
+ * Create a pending token record.
26
+ * @see tokenize
27
+ */
28
+ tokenize(params: TokenizeParams): Promise<{
29
+ success: true;
30
+ data: TokenizeResponse;
31
+ }>;
32
+ /**
33
+ * Fetch a deployed token by contract address.
34
+ * @see getToken
35
+ */
36
+ getToken(address: string): Promise<Token>;
37
+ /**
38
+ * List tokens with optional filtering and pagination.
39
+ * @see listTokens
40
+ */
41
+ listTokens(params?: TokenListParams): Promise<TokenListResponse>;
42
+ }
43
+ /** Market data operations. */
44
+ export interface MarketNamespace {
45
+ /**
46
+ * Get the current bonding-curve price in FET.
47
+ * @see getTokenPrice
48
+ */
49
+ getTokenPrice(address: string): Promise<string>;
50
+ /**
51
+ * Get the holder list, or look up a specific wallet.
52
+ * @see getTokenHolders
53
+ */
54
+ getTokenHolders(address: string, holderAddress?: string): Promise<HolderListResponse | SingleHolderResponse>;
55
+ }
56
+ /** Handoff link generation (synchronous). */
57
+ export interface HandoffNamespace {
58
+ /**
59
+ * Generate a deploy handoff link for a pending token.
60
+ * @see generateDeployLink
61
+ */
62
+ generateDeployLink(tokenId: number, baseUrl?: string): string;
63
+ /**
64
+ * Generate a trade handoff link for a deployed token.
65
+ * @see generateTradeLink
66
+ */
67
+ generateTradeLink(address: string, opts?: TradeLinkOptions, baseUrl?: string): string;
68
+ /**
69
+ * Generate a buy link with optional pre-filled FET amount.
70
+ * @see generateBuyLink
71
+ */
72
+ generateBuyLink(address: string, amount?: number | string, baseUrl?: string): string;
73
+ /**
74
+ * Generate a sell link with optional pre-filled token amount.
75
+ * @see generateSellLink
76
+ */
77
+ generateSellLink(address: string, amount?: number | string, baseUrl?: string): string;
78
+ }
79
+ /** Agent authentication and management. */
80
+ export interface AgentsNamespace {
81
+ /**
82
+ * Exchange an Agentverse API key for a platform JWT.
83
+ * @see authenticate
84
+ */
85
+ authenticate(apiKey: string): Promise<AgentAuthResponse>;
86
+ /**
87
+ * List the Agentverse agents owned by the caller's API key.
88
+ * @see getMyAgents
89
+ */
90
+ getMyAgents(): Promise<MyAgentsResponse>;
91
+ /**
92
+ * Import agents by Agentverse API key.
93
+ * @see importFromAgentverse
94
+ */
95
+ importFromAgentverse(agentverseApiKey: string): Promise<ImportAgentverseResponse>;
96
+ }
97
+ /**
98
+ * AgentLaunch
99
+ *
100
+ * Fluent, namespaced wrapper around the AgentLaunch SDK modules. Instantiate
101
+ * once and use the `tokens`, `market`, `handoff`, and `agents` namespaces to
102
+ * access all platform operations.
103
+ *
104
+ * Authentication is shared across all namespaces via the underlying
105
+ * `AgentLaunchClient` instance.
106
+ *
107
+ * @example
108
+ * ```ts
109
+ * import { AgentLaunch } from '@agent-launch/sdk';
110
+ *
111
+ * const al = new AgentLaunch({ apiKey: 'av-xxxxxxxxxxxxxxxx' });
112
+ *
113
+ * // Create token
114
+ * const { data } = await al.tokens.tokenize({ agentAddress: 'agent1q...' });
115
+ *
116
+ * // Generate links
117
+ * const deployLink = al.handoff.generateDeployLink(data.token_id);
118
+ * const buyLink = al.handoff.generateBuyLink('0xAbCd...', 100);
119
+ *
120
+ * // Query market
121
+ * const price = await al.market.getTokenPrice('0xAbCd...');
122
+ * const { holders } = await al.market.getTokenHolders('0xAbCd...');
123
+ * ```
124
+ */
125
+ export declare class AgentLaunch {
126
+ /** The underlying HTTP client shared by all namespaces. */
127
+ readonly client: AgentLaunchClient;
128
+ /** Token CRUD and listing operations. */
129
+ readonly tokens: TokensNamespace;
130
+ /** Price, holder, and trade-link operations. */
131
+ readonly market: MarketNamespace;
132
+ /** Handoff URL generation (synchronous, no network calls). */
133
+ readonly handoff: HandoffNamespace;
134
+ /** Agent authentication and Agentverse management. */
135
+ readonly agents: AgentsNamespace;
136
+ constructor(config?: AgentLaunchConfig);
137
+ }
138
+ //# sourceMappingURL=agentlaunch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentlaunch.d.ts","sourceRoot":"","sources":["../src/agentlaunch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUhD,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAMpB,gCAAgC;AAChC,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CACN,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,gBAAgB,CAAA;KAAE,CAAC,CAAC;IAEtD;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE1C;;;OAGG;IACH,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAClE;AAED,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG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AM,EAAE,eAAe,CAAC;IAEjC,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IAEnC,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;gBAErB,MAAM,GAAE,iBAAsB;CA+C3C"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @agent-launch/sdk — AgentLaunch fluent wrapper class
3
+ *
4
+ * SDK-006: Provides a namespaced, ergonomic API wrapping all SDK modules.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { AgentLaunch } from '@agent-launch/sdk';
9
+ *
10
+ * const al = new AgentLaunch({ apiKey: process.env.AGENTVERSE_API_KEY });
11
+ *
12
+ * const { data } = await al.tokens.tokenize({
13
+ * agentAddress: 'agent1qf8xfhsc8hg4g5l0nhtj...',
14
+ * chainId: 97,
15
+ * });
16
+ *
17
+ * const link = al.handoff.generateDeployLink(data.token_id);
18
+ * ```
19
+ */
20
+ import { AgentLaunchClient } from './client.js';
21
+ import { tokenize, getToken, listTokens } from './tokens.js';
22
+ import { getTokenPrice, getTokenHolders } from './market.js';
23
+ import { generateDeployLink, generateTradeLink, generateBuyLink, generateSellLink, } from './handoff.js';
24
+ import { authenticate, getMyAgents, importFromAgentverse } from './agents.js';
25
+ // ---------------------------------------------------------------------------
26
+ // AgentLaunch class
27
+ // ---------------------------------------------------------------------------
28
+ /**
29
+ * AgentLaunch
30
+ *
31
+ * Fluent, namespaced wrapper around the AgentLaunch SDK modules. Instantiate
32
+ * once and use the `tokens`, `market`, `handoff`, and `agents` namespaces to
33
+ * access all platform operations.
34
+ *
35
+ * Authentication is shared across all namespaces via the underlying
36
+ * `AgentLaunchClient` instance.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * import { AgentLaunch } from '@agent-launch/sdk';
41
+ *
42
+ * const al = new AgentLaunch({ apiKey: 'av-xxxxxxxxxxxxxxxx' });
43
+ *
44
+ * // Create token
45
+ * const { data } = await al.tokens.tokenize({ agentAddress: 'agent1q...' });
46
+ *
47
+ * // Generate links
48
+ * const deployLink = al.handoff.generateDeployLink(data.token_id);
49
+ * const buyLink = al.handoff.generateBuyLink('0xAbCd...', 100);
50
+ *
51
+ * // Query market
52
+ * const price = await al.market.getTokenPrice('0xAbCd...');
53
+ * const { holders } = await al.market.getTokenHolders('0xAbCd...');
54
+ * ```
55
+ */
56
+ export class AgentLaunch {
57
+ constructor(config = {}) {
58
+ this.client = new AgentLaunchClient(config);
59
+ // Capture client reference for closures
60
+ const client = this.client;
61
+ this.tokens = {
62
+ tokenize: (params) => tokenize(params, client),
63
+ getToken: (address) => getToken(address, client),
64
+ listTokens: (params) => listTokens(params ?? {}, client),
65
+ };
66
+ this.market = {
67
+ getTokenPrice: (address) => getTokenPrice(address, client),
68
+ getTokenHolders: (address, holderAddress) => getTokenHolders(address, holderAddress, client),
69
+ };
70
+ // Handoff methods use the client's baseUrl for URL generation
71
+ const baseUrl = this.client.baseUrl;
72
+ this.handoff = {
73
+ generateDeployLink: (tokenId, overrideBaseUrl) => generateDeployLink(tokenId, overrideBaseUrl ?? baseUrl),
74
+ generateTradeLink: (address, opts, overrideBaseUrl) => generateTradeLink(address, opts, overrideBaseUrl ?? baseUrl),
75
+ generateBuyLink: (address, amount, overrideBaseUrl) => generateBuyLink(address, amount, overrideBaseUrl ?? baseUrl),
76
+ generateSellLink: (address, amount, overrideBaseUrl) => generateSellLink(address, amount, overrideBaseUrl ?? baseUrl),
77
+ };
78
+ this.agents = {
79
+ authenticate: (apiKey) => authenticate(apiKey, client),
80
+ getMyAgents: () => getMyAgents(client),
81
+ importFromAgentverse: (agentverseApiKey) => importFromAgentverse(agentverseApiKey, client),
82
+ };
83
+ }
84
+ }
85
+ //# sourceMappingURL=agentlaunch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentlaunch.js","sourceRoot":"","sources":["../src/agentlaunch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,iBAAiB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QACpC,IAAI,CAAC,OAAO,GAAG;YACb,kBAAkB,EAAE,CAAC,OAAe,EAAE,eAAwB,EAAE,EAAE,CAChE,kBAAkB,CAAC,OAAO,EAAE,eAAe,IAAI,OAAO,CAAC;YACzD,iBAAiB,EAAE,CACjB,OAAe,EACf,IAAuB,EACvB,eAAwB,EACxB,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,IAAI,OAAO,CAAC;YACjE,eAAe,EAAE,CACf,OAAe,EACf,MAAwB,EACxB,eAAwB,EACxB,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,IAAI,OAAO,CAAC;YACjE,gBAAgB,EAAE,CAChB,OAAe,EACf,MAAwB,EACxB,eAAwB,EACxB,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,IAAI,OAAO,CAAC;SACnE,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG;YACZ,YAAY,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;YAC9D,WAAW,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC;YACtC,oBAAoB,EAAE,CAAC,gBAAwB,EAAE,EAAE,CACjD,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,CAAC;SACjD,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @agent-launch/sdk — Agent operations
3
+ *
4
+ * SDK-005: Authentication and Agentverse agent management.
5
+ *
6
+ * These endpoints let an agent:
7
+ * - Exchange an Agentverse API key for a platform JWT (POST /agents/auth)
8
+ * - List its own Agentverse agents (GET /agents/my-agents)
9
+ * - Import agent metadata by API key (POST /agents/import-agentverse)
10
+ */
11
+ import { AgentLaunchClient } from './client.js';
12
+ import type { AgentAuthResponse, MyAgentsResponse, ImportAgentverseResponse } from './types.js';
13
+ /**
14
+ * Exchange an Agentverse API key for a platform JWT.
15
+ *
16
+ * The JWT can be used as a `Bearer` token on any endpoint that requires
17
+ * platform authentication (same access level as an X-API-Key header).
18
+ *
19
+ * Rate limit: 10 requests per 60 seconds.
20
+ *
21
+ * @param apiKey Agentverse API key (av-…)
22
+ * @param client Optional pre-configured client instance
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const { data } = await authenticate('av-xxxxxxxxxxxxxxxx');
27
+ * // data.token — JWT string
28
+ * // data.expires_in — seconds until expiry
29
+ * ```
30
+ */
31
+ export declare function authenticate(apiKey: string, client?: AgentLaunchClient): Promise<AgentAuthResponse>;
32
+ /**
33
+ * List the Agentverse agents owned by the caller's API key.
34
+ *
35
+ * Requires X-API-Key authentication.
36
+ *
37
+ * Rate limit: 30 requests per 60 seconds.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const { data } = await getMyAgents();
42
+ * console.log(data.agents.map(a => a.address));
43
+ * ```
44
+ */
45
+ export declare function getMyAgents(client?: AgentLaunchClient): Promise<MyAgentsResponse>;
46
+ /**
47
+ * Fetch all agents belonging to the supplied Agentverse API key.
48
+ *
49
+ * No platform authentication is required — the caller provides their own
50
+ * Agentverse key in the request body. Results are cached on the server
51
+ * for 5 minutes.
52
+ *
53
+ * Useful for building integrations that need to enumerate an account's
54
+ * agents without a pre-existing platform session.
55
+ *
56
+ * Rate limit: 5 requests per 60 seconds.
57
+ *
58
+ * @param agentverseApiKey Agentverse API key to import agents from
59
+ * @param client Optional pre-configured client instance
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const { agents, count } = await importFromAgentverse('av-xxxxxxxxxxxxxxxx');
64
+ * ```
65
+ */
66
+ export declare function importFromAgentverse(agentverseApiKey: string, client?: AgentLaunchClient): Promise<ImportAgentverseResponse>;
67
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAiBpB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC,CAc5B;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAC/B,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAG3B;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,oBAAoB,CACxC,gBAAgB,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,wBAAwB,CAAC,CAWnC"}