logiqical 0.0.9 → 0.0.11
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 +64 -8
- package/dist/index.d.mts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +47 -0
- package/dist/index.mjs +47 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# logiqical
|
|
2
2
|
|
|
3
|
-
The complete SDK for AI agents trading on Avalanche. Swaps, staking, launchpad, DEX — one package, zero config.
|
|
3
|
+
The complete SDK for AI agents trading on Avalanche. Swaps, staking, launchpad, token launches, DEX — one package, zero config.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -22,6 +22,12 @@ const bal = await client.swap.getBalances("0xYourWallet");
|
|
|
22
22
|
// Discover trending launchpad tokens
|
|
23
23
|
const hot = await client.launchpad.getTopVolume("24h");
|
|
24
24
|
|
|
25
|
+
// Launch your own token on Arena
|
|
26
|
+
const launch = await client.launchpad.launch(wallet, "My Token", "MTK", imageBase64);
|
|
27
|
+
|
|
28
|
+
// Buy a graduated token via Arena DEX
|
|
29
|
+
const buy = await client.launchpad.buildBuy(wallet, tokenId, "0.1");
|
|
30
|
+
|
|
25
31
|
// Swap any token pair
|
|
26
32
|
const tx = await client.dex.buildSwap(wallet, "AVAX", "USDC", "1.0");
|
|
27
33
|
|
|
@@ -50,8 +56,9 @@ await client.broadcast(signedTx);
|
|
|
50
56
|
| `buildBuyAndStake(wallet, avax, slippage?)` | Buy + stake in one flow |
|
|
51
57
|
| `buildUnstake(wallet, amount)` | Unstake and claim rewards |
|
|
52
58
|
|
|
53
|
-
### `client.launchpad` — Token Discovery &
|
|
59
|
+
### `client.launchpad` — Token Discovery, Trading & Launch
|
|
54
60
|
|
|
61
|
+
#### Discovery
|
|
55
62
|
| Method | Description |
|
|
56
63
|
|--------|-------------|
|
|
57
64
|
| `getRecent(count?, type?)` | Latest launched tokens |
|
|
@@ -59,6 +66,10 @@ await client.broadcast(signedTx);
|
|
|
59
66
|
| `getGraduating(count?)` | Tokens about to graduate to DEX |
|
|
60
67
|
| `getGraduated(count?)` | Already graduated tokens |
|
|
61
68
|
| `search(query)` | Find by name, symbol, or address |
|
|
69
|
+
|
|
70
|
+
#### Intelligence
|
|
71
|
+
| Method | Description |
|
|
72
|
+
|--------|-------------|
|
|
62
73
|
| `getToken(tokenId?, address?)` | Full token profile + stats |
|
|
63
74
|
| `getHolders(address?, tokenId?, count?)` | Top holders with PnL |
|
|
64
75
|
| `getActivity(tokenId?, address?, count?)` | Recent trade history |
|
|
@@ -67,8 +78,19 @@ await client.broadcast(signedTx);
|
|
|
67
78
|
| `getPortfolio(wallet)` | Your tracked positions |
|
|
68
79
|
| `getMarketCap(tokenId)` | Market cap breakdown |
|
|
69
80
|
| `getOverview()` | Platform stats |
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
|
|
82
|
+
#### Trading
|
|
83
|
+
| Method | Description |
|
|
84
|
+
|--------|-------------|
|
|
85
|
+
| `buildBuy(wallet, tokenId, avax, slippage?)` | Buy launchpad token (auto-routes graduated tokens via Arena DEX) |
|
|
86
|
+
| `buildSell(wallet, tokenId, amount, slippage?)` | Sell (`"max"` for all, auto-routes graduated) |
|
|
87
|
+
|
|
88
|
+
#### Token Launch
|
|
89
|
+
| Method | Description |
|
|
90
|
+
|--------|-------------|
|
|
91
|
+
| `launch(wallet, name, symbol, imageBase64?, paymentToken?, initialBuyAvax?)` | Full token launch — uploads image, creates Arena community, returns createToken tx |
|
|
92
|
+
| `uploadImage(imageBase64, fileType?)` | Upload token image to Arena CDN |
|
|
93
|
+
| `buildCreate(wallet, name, symbol, paymentToken?, initialBuyAvax?)` | Build only the createToken tx |
|
|
72
94
|
|
|
73
95
|
### `client.dex` — Swap Any Avalanche Token
|
|
74
96
|
|
|
@@ -88,6 +110,39 @@ await client.broadcast(signedTx);
|
|
|
88
110
|
| `client.health()` | API health check |
|
|
89
111
|
| `client.getInstructions()` | Full agent documentation |
|
|
90
112
|
|
|
113
|
+
## Token Launch Flow
|
|
114
|
+
|
|
115
|
+
Agents can launch their own tokens on Arena with a single SDK call:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { readFileSync } from "fs";
|
|
119
|
+
|
|
120
|
+
const imageBase64 = readFileSync("token-logo.jpg").toString("base64");
|
|
121
|
+
|
|
122
|
+
const result = await client.launchpad.launch(
|
|
123
|
+
"0xYourWallet",
|
|
124
|
+
"My Token", // token name
|
|
125
|
+
"MTK", // ticker symbol
|
|
126
|
+
imageBase64, // token image (optional)
|
|
127
|
+
"arena", // "arena" or "avax" paired
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
// result.transaction — unsigned createToken tx to sign & broadcast
|
|
131
|
+
// result.community — Arena community metadata
|
|
132
|
+
// result.imageUrl — hosted image URL
|
|
133
|
+
// result.instructions — step-by-step next actions
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Graduated Token Trading
|
|
137
|
+
|
|
138
|
+
Tokens that graduate from the bonding curve automatically trade via Arena's DEX router. The SDK handles this seamlessly — `buildBuy` and `buildSell` detect graduation and route through Arena's Uniswap V4 pools + Yield Yak aggregator.
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
// Works for both bonding curve AND graduated tokens
|
|
142
|
+
const buy = await client.launchpad.buildBuy(wallet, tokenId, "0.5");
|
|
143
|
+
// → Routes via bonding curve OR Arena DEX automatically
|
|
144
|
+
```
|
|
145
|
+
|
|
91
146
|
## How It Works
|
|
92
147
|
|
|
93
148
|
1. **Install** — `npm install logiqical`
|
|
@@ -115,14 +170,15 @@ const client = new LogiqicalClient({
|
|
|
115
170
|
- **JSDoc everywhere** — AI agents understand methods from hover info
|
|
116
171
|
- **Zero dependencies** — uses native `fetch` (Node 18+)
|
|
117
172
|
- **CJS + ESM** — works with `require()` and `import`
|
|
118
|
-
- **
|
|
173
|
+
- **35+ methods** across 4 modules
|
|
174
|
+
- **Token launches** — create tokens on Arena with image upload
|
|
175
|
+
- **Smart routing** — graduated tokens auto-route via Arena DEX
|
|
119
176
|
|
|
120
177
|
## Built on
|
|
121
178
|
|
|
122
179
|
- [Avalanche C-Chain](https://avax.network)
|
|
123
|
-
- [
|
|
124
|
-
- [
|
|
125
|
-
- [Arena](https://arenatrade.ai)
|
|
180
|
+
- [Arena](https://arena.social)
|
|
181
|
+
- [Arena DEX Router](https://snowtrace.io/address/0xDE9D7290959b6060860b983b32f2d65b2701EBC2)
|
|
126
182
|
|
|
127
183
|
## License
|
|
128
184
|
|
package/dist/index.d.mts
CHANGED
|
@@ -195,6 +195,32 @@ interface LaunchpadSellResponse {
|
|
|
195
195
|
summary?: string;
|
|
196
196
|
note?: string;
|
|
197
197
|
}
|
|
198
|
+
interface ArenaCommunity {
|
|
199
|
+
id: string;
|
|
200
|
+
signer: string;
|
|
201
|
+
isTemporary: boolean;
|
|
202
|
+
name: string;
|
|
203
|
+
tokenName: string;
|
|
204
|
+
ticker: string;
|
|
205
|
+
photoURL: string;
|
|
206
|
+
paymentToken: string;
|
|
207
|
+
contractAddress: string | null;
|
|
208
|
+
createdOn: string;
|
|
209
|
+
}
|
|
210
|
+
interface LaunchTokenResponse {
|
|
211
|
+
community: ArenaCommunity;
|
|
212
|
+
imageUrl: string;
|
|
213
|
+
transaction: UnsignedTx;
|
|
214
|
+
nextTokenId: string;
|
|
215
|
+
instructions: string[];
|
|
216
|
+
}
|
|
217
|
+
interface UploadImageResponse {
|
|
218
|
+
imageUrl: string;
|
|
219
|
+
}
|
|
220
|
+
interface BuildCreateResponse {
|
|
221
|
+
transaction: UnsignedTx;
|
|
222
|
+
nextTokenId: string;
|
|
223
|
+
}
|
|
198
224
|
interface DexTokenEntry {
|
|
199
225
|
symbol: string;
|
|
200
226
|
address: string;
|
|
@@ -407,6 +433,36 @@ declare class LaunchpadModule {
|
|
|
407
433
|
* @param offset - Pagination offset
|
|
408
434
|
*/
|
|
409
435
|
getTrades(count?: number, offset?: number): Promise<GlobalTradesResponse>;
|
|
436
|
+
/**
|
|
437
|
+
* Launch a new token on Arena — uploads image, creates community, and returns the unsigned createToken transaction.
|
|
438
|
+
*
|
|
439
|
+
* @param wallet - Creator wallet address
|
|
440
|
+
* @param name - Token name (also used as community name)
|
|
441
|
+
* @param symbol - Token ticker symbol
|
|
442
|
+
* @param imageBase64 - Token image as base64 string (optional)
|
|
443
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
444
|
+
* @param initialBuyAvax - AVAX amount for initial buy at creation (default: "0")
|
|
445
|
+
*/
|
|
446
|
+
launch(wallet: string, name: string, symbol: string, imageBase64?: string, paymentToken?: "avax" | "arena", initialBuyAvax?: string): Promise<LaunchTokenResponse>;
|
|
447
|
+
/**
|
|
448
|
+
* Upload a token image to Arena's CDN and get the hosted URL.
|
|
449
|
+
* Use this before launch() if you want to preview the image URL first.
|
|
450
|
+
*
|
|
451
|
+
* @param imageBase64 - Image as base64 string
|
|
452
|
+
* @param fileType - MIME type (default: "image/jpeg")
|
|
453
|
+
*/
|
|
454
|
+
uploadImage(imageBase64: string, fileType?: string): Promise<UploadImageResponse>;
|
|
455
|
+
/**
|
|
456
|
+
* Build only the createToken transaction (no image or community creation).
|
|
457
|
+
* Useful if you want to handle image upload and community creation separately.
|
|
458
|
+
*
|
|
459
|
+
* @param wallet - Creator wallet address
|
|
460
|
+
* @param name - Token name
|
|
461
|
+
* @param symbol - Token ticker symbol
|
|
462
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
463
|
+
* @param initialBuyAvax - AVAX for initial buy (default: "0")
|
|
464
|
+
*/
|
|
465
|
+
buildCreate(wallet: string, name: string, symbol: string, paymentToken?: "avax" | "arena", initialBuyAvax?: string): Promise<BuildCreateResponse>;
|
|
410
466
|
/**
|
|
411
467
|
* Build unsigned transaction to buy a launchpad token with AVAX.
|
|
412
468
|
*
|
|
@@ -549,4 +605,4 @@ declare class LogiqicalAuthError extends LogiqicalError {
|
|
|
549
605
|
constructor(endpoint: string);
|
|
550
606
|
}
|
|
551
607
|
|
|
552
|
-
export { type BalancesResponse, type BroadcastResponse, type BuyQuoteResponse, type DexBalanceResponse, DexModule, type DexQuoteResponse, type DexSwapResponse, type DexTokenEntry, type DexTokenInfoResponse, type DexTokensResponse, type GlobalTradeEntry, type GlobalTradesResponse, type HealthResponse, type HolderEntry, type LaunchpadBuyResponse, type LaunchpadListResponse, LaunchpadModule, type LaunchpadQuoteResponse, type LaunchpadSellResponse, type LaunchpadToken, LogiqicalAuthError, LogiqicalClient, type LogiqicalConfig, LogiqicalError, type RegisterResponse, type SellQuoteResponse, type StakeBuildResponse, type StakeInfoResponse, StakingModule, type SwapBuyResponse, SwapModule, type SwapSellResponse, type TokenActivityResponse, type TokenCreator, type TokenDetailResponse, type TokenHoldersResponse, type TokenStatsTimeframes, type TradeEntry, type UnsignedTx };
|
|
608
|
+
export { type ArenaCommunity, type BalancesResponse, type BroadcastResponse, type BuildCreateResponse, type BuyQuoteResponse, type DexBalanceResponse, DexModule, type DexQuoteResponse, type DexSwapResponse, type DexTokenEntry, type DexTokenInfoResponse, type DexTokensResponse, type GlobalTradeEntry, type GlobalTradesResponse, type HealthResponse, type HolderEntry, type LaunchTokenResponse, type LaunchpadBuyResponse, type LaunchpadListResponse, LaunchpadModule, type LaunchpadQuoteResponse, type LaunchpadSellResponse, type LaunchpadToken, LogiqicalAuthError, LogiqicalClient, type LogiqicalConfig, LogiqicalError, type RegisterResponse, type SellQuoteResponse, type StakeBuildResponse, type StakeInfoResponse, StakingModule, type SwapBuyResponse, SwapModule, type SwapSellResponse, type TokenActivityResponse, type TokenCreator, type TokenDetailResponse, type TokenHoldersResponse, type TokenStatsTimeframes, type TradeEntry, type UnsignedTx, type UploadImageResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -195,6 +195,32 @@ interface LaunchpadSellResponse {
|
|
|
195
195
|
summary?: string;
|
|
196
196
|
note?: string;
|
|
197
197
|
}
|
|
198
|
+
interface ArenaCommunity {
|
|
199
|
+
id: string;
|
|
200
|
+
signer: string;
|
|
201
|
+
isTemporary: boolean;
|
|
202
|
+
name: string;
|
|
203
|
+
tokenName: string;
|
|
204
|
+
ticker: string;
|
|
205
|
+
photoURL: string;
|
|
206
|
+
paymentToken: string;
|
|
207
|
+
contractAddress: string | null;
|
|
208
|
+
createdOn: string;
|
|
209
|
+
}
|
|
210
|
+
interface LaunchTokenResponse {
|
|
211
|
+
community: ArenaCommunity;
|
|
212
|
+
imageUrl: string;
|
|
213
|
+
transaction: UnsignedTx;
|
|
214
|
+
nextTokenId: string;
|
|
215
|
+
instructions: string[];
|
|
216
|
+
}
|
|
217
|
+
interface UploadImageResponse {
|
|
218
|
+
imageUrl: string;
|
|
219
|
+
}
|
|
220
|
+
interface BuildCreateResponse {
|
|
221
|
+
transaction: UnsignedTx;
|
|
222
|
+
nextTokenId: string;
|
|
223
|
+
}
|
|
198
224
|
interface DexTokenEntry {
|
|
199
225
|
symbol: string;
|
|
200
226
|
address: string;
|
|
@@ -407,6 +433,36 @@ declare class LaunchpadModule {
|
|
|
407
433
|
* @param offset - Pagination offset
|
|
408
434
|
*/
|
|
409
435
|
getTrades(count?: number, offset?: number): Promise<GlobalTradesResponse>;
|
|
436
|
+
/**
|
|
437
|
+
* Launch a new token on Arena — uploads image, creates community, and returns the unsigned createToken transaction.
|
|
438
|
+
*
|
|
439
|
+
* @param wallet - Creator wallet address
|
|
440
|
+
* @param name - Token name (also used as community name)
|
|
441
|
+
* @param symbol - Token ticker symbol
|
|
442
|
+
* @param imageBase64 - Token image as base64 string (optional)
|
|
443
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
444
|
+
* @param initialBuyAvax - AVAX amount for initial buy at creation (default: "0")
|
|
445
|
+
*/
|
|
446
|
+
launch(wallet: string, name: string, symbol: string, imageBase64?: string, paymentToken?: "avax" | "arena", initialBuyAvax?: string): Promise<LaunchTokenResponse>;
|
|
447
|
+
/**
|
|
448
|
+
* Upload a token image to Arena's CDN and get the hosted URL.
|
|
449
|
+
* Use this before launch() if you want to preview the image URL first.
|
|
450
|
+
*
|
|
451
|
+
* @param imageBase64 - Image as base64 string
|
|
452
|
+
* @param fileType - MIME type (default: "image/jpeg")
|
|
453
|
+
*/
|
|
454
|
+
uploadImage(imageBase64: string, fileType?: string): Promise<UploadImageResponse>;
|
|
455
|
+
/**
|
|
456
|
+
* Build only the createToken transaction (no image or community creation).
|
|
457
|
+
* Useful if you want to handle image upload and community creation separately.
|
|
458
|
+
*
|
|
459
|
+
* @param wallet - Creator wallet address
|
|
460
|
+
* @param name - Token name
|
|
461
|
+
* @param symbol - Token ticker symbol
|
|
462
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
463
|
+
* @param initialBuyAvax - AVAX for initial buy (default: "0")
|
|
464
|
+
*/
|
|
465
|
+
buildCreate(wallet: string, name: string, symbol: string, paymentToken?: "avax" | "arena", initialBuyAvax?: string): Promise<BuildCreateResponse>;
|
|
410
466
|
/**
|
|
411
467
|
* Build unsigned transaction to buy a launchpad token with AVAX.
|
|
412
468
|
*
|
|
@@ -549,4 +605,4 @@ declare class LogiqicalAuthError extends LogiqicalError {
|
|
|
549
605
|
constructor(endpoint: string);
|
|
550
606
|
}
|
|
551
607
|
|
|
552
|
-
export { type BalancesResponse, type BroadcastResponse, type BuyQuoteResponse, type DexBalanceResponse, DexModule, type DexQuoteResponse, type DexSwapResponse, type DexTokenEntry, type DexTokenInfoResponse, type DexTokensResponse, type GlobalTradeEntry, type GlobalTradesResponse, type HealthResponse, type HolderEntry, type LaunchpadBuyResponse, type LaunchpadListResponse, LaunchpadModule, type LaunchpadQuoteResponse, type LaunchpadSellResponse, type LaunchpadToken, LogiqicalAuthError, LogiqicalClient, type LogiqicalConfig, LogiqicalError, type RegisterResponse, type SellQuoteResponse, type StakeBuildResponse, type StakeInfoResponse, StakingModule, type SwapBuyResponse, SwapModule, type SwapSellResponse, type TokenActivityResponse, type TokenCreator, type TokenDetailResponse, type TokenHoldersResponse, type TokenStatsTimeframes, type TradeEntry, type UnsignedTx };
|
|
608
|
+
export { type ArenaCommunity, type BalancesResponse, type BroadcastResponse, type BuildCreateResponse, type BuyQuoteResponse, type DexBalanceResponse, DexModule, type DexQuoteResponse, type DexSwapResponse, type DexTokenEntry, type DexTokenInfoResponse, type DexTokensResponse, type GlobalTradeEntry, type GlobalTradesResponse, type HealthResponse, type HolderEntry, type LaunchTokenResponse, type LaunchpadBuyResponse, type LaunchpadListResponse, LaunchpadModule, type LaunchpadQuoteResponse, type LaunchpadSellResponse, type LaunchpadToken, LogiqicalAuthError, LogiqicalClient, type LogiqicalConfig, LogiqicalError, type RegisterResponse, type SellQuoteResponse, type StakeBuildResponse, type StakeInfoResponse, StakingModule, type SwapBuyResponse, SwapModule, type SwapSellResponse, type TokenActivityResponse, type TokenCreator, type TokenDetailResponse, type TokenHoldersResponse, type TokenStatsTimeframes, type TradeEntry, type UnsignedTx, type UploadImageResponse };
|
package/dist/index.js
CHANGED
|
@@ -327,6 +327,53 @@ var LaunchpadModule = class {
|
|
|
327
327
|
await this.auth();
|
|
328
328
|
return this.http.get("/launchpad/trades", { count, offset });
|
|
329
329
|
}
|
|
330
|
+
// ── Token Launch ──
|
|
331
|
+
/**
|
|
332
|
+
* Launch a new token on Arena — uploads image, creates community, and returns the unsigned createToken transaction.
|
|
333
|
+
*
|
|
334
|
+
* @param wallet - Creator wallet address
|
|
335
|
+
* @param name - Token name (also used as community name)
|
|
336
|
+
* @param symbol - Token ticker symbol
|
|
337
|
+
* @param imageBase64 - Token image as base64 string (optional)
|
|
338
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
339
|
+
* @param initialBuyAvax - AVAX amount for initial buy at creation (default: "0")
|
|
340
|
+
*/
|
|
341
|
+
async launch(wallet, name, symbol, imageBase64, paymentToken = "arena", initialBuyAvax = "0") {
|
|
342
|
+
await this.auth();
|
|
343
|
+
return this.http.post("/launchpad/launch", {
|
|
344
|
+
wallet,
|
|
345
|
+
name,
|
|
346
|
+
symbol,
|
|
347
|
+
imageBase64,
|
|
348
|
+
paymentToken,
|
|
349
|
+
initialBuyAvax
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Upload a token image to Arena's CDN and get the hosted URL.
|
|
354
|
+
* Use this before launch() if you want to preview the image URL first.
|
|
355
|
+
*
|
|
356
|
+
* @param imageBase64 - Image as base64 string
|
|
357
|
+
* @param fileType - MIME type (default: "image/jpeg")
|
|
358
|
+
*/
|
|
359
|
+
async uploadImage(imageBase64, fileType = "image/jpeg") {
|
|
360
|
+
await this.auth();
|
|
361
|
+
return this.http.post("/launchpad/upload-image", { imageBase64, fileType });
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Build only the createToken transaction (no image or community creation).
|
|
365
|
+
* Useful if you want to handle image upload and community creation separately.
|
|
366
|
+
*
|
|
367
|
+
* @param wallet - Creator wallet address
|
|
368
|
+
* @param name - Token name
|
|
369
|
+
* @param symbol - Token ticker symbol
|
|
370
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
371
|
+
* @param initialBuyAvax - AVAX for initial buy (default: "0")
|
|
372
|
+
*/
|
|
373
|
+
async buildCreate(wallet, name, symbol, paymentToken = "arena", initialBuyAvax = "0") {
|
|
374
|
+
await this.auth();
|
|
375
|
+
return this.http.get("/launchpad/build/create", { wallet, name, symbol, paymentToken, initialBuyAvax });
|
|
376
|
+
}
|
|
330
377
|
// ── Trading ──
|
|
331
378
|
/**
|
|
332
379
|
* Build unsigned transaction to buy a launchpad token with AVAX.
|
package/dist/index.mjs
CHANGED
|
@@ -295,6 +295,53 @@ var LaunchpadModule = class {
|
|
|
295
295
|
await this.auth();
|
|
296
296
|
return this.http.get("/launchpad/trades", { count, offset });
|
|
297
297
|
}
|
|
298
|
+
// ── Token Launch ──
|
|
299
|
+
/**
|
|
300
|
+
* Launch a new token on Arena — uploads image, creates community, and returns the unsigned createToken transaction.
|
|
301
|
+
*
|
|
302
|
+
* @param wallet - Creator wallet address
|
|
303
|
+
* @param name - Token name (also used as community name)
|
|
304
|
+
* @param symbol - Token ticker symbol
|
|
305
|
+
* @param imageBase64 - Token image as base64 string (optional)
|
|
306
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
307
|
+
* @param initialBuyAvax - AVAX amount for initial buy at creation (default: "0")
|
|
308
|
+
*/
|
|
309
|
+
async launch(wallet, name, symbol, imageBase64, paymentToken = "arena", initialBuyAvax = "0") {
|
|
310
|
+
await this.auth();
|
|
311
|
+
return this.http.post("/launchpad/launch", {
|
|
312
|
+
wallet,
|
|
313
|
+
name,
|
|
314
|
+
symbol,
|
|
315
|
+
imageBase64,
|
|
316
|
+
paymentToken,
|
|
317
|
+
initialBuyAvax
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Upload a token image to Arena's CDN and get the hosted URL.
|
|
322
|
+
* Use this before launch() if you want to preview the image URL first.
|
|
323
|
+
*
|
|
324
|
+
* @param imageBase64 - Image as base64 string
|
|
325
|
+
* @param fileType - MIME type (default: "image/jpeg")
|
|
326
|
+
*/
|
|
327
|
+
async uploadImage(imageBase64, fileType = "image/jpeg") {
|
|
328
|
+
await this.auth();
|
|
329
|
+
return this.http.post("/launchpad/upload-image", { imageBase64, fileType });
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Build only the createToken transaction (no image or community creation).
|
|
333
|
+
* Useful if you want to handle image upload and community creation separately.
|
|
334
|
+
*
|
|
335
|
+
* @param wallet - Creator wallet address
|
|
336
|
+
* @param name - Token name
|
|
337
|
+
* @param symbol - Token ticker symbol
|
|
338
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
339
|
+
* @param initialBuyAvax - AVAX for initial buy (default: "0")
|
|
340
|
+
*/
|
|
341
|
+
async buildCreate(wallet, name, symbol, paymentToken = "arena", initialBuyAvax = "0") {
|
|
342
|
+
await this.auth();
|
|
343
|
+
return this.http.get("/launchpad/build/create", { wallet, name, symbol, paymentToken, initialBuyAvax });
|
|
344
|
+
}
|
|
298
345
|
// ── Trading ──
|
|
299
346
|
/**
|
|
300
347
|
* Build unsigned transaction to buy a launchpad token with AVAX.
|