logiqical 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/dist/index.d.mts +552 -0
- package/dist/index.d.ts +552 -0
- package/dist/index.js +508 -0
- package/dist/index.mjs +475 -0
- package/package.json +35 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
declare class HttpClient {
|
|
2
|
+
private baseUrl;
|
|
3
|
+
private apiKey;
|
|
4
|
+
constructor(baseUrl: string, apiKey?: string);
|
|
5
|
+
setApiKey(key: string): void;
|
|
6
|
+
getApiKey(): string | null;
|
|
7
|
+
get<T>(path: string, params?: Record<string, string | number | undefined>, skipAuth?: boolean): Promise<T>;
|
|
8
|
+
post<T>(path: string, body: Record<string, unknown>): Promise<T>;
|
|
9
|
+
private handleResponse;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Unsigned transaction ready to be signed and broadcast */
|
|
13
|
+
interface UnsignedTx {
|
|
14
|
+
to: string;
|
|
15
|
+
data: string;
|
|
16
|
+
value: string;
|
|
17
|
+
chainId: number;
|
|
18
|
+
gas?: string;
|
|
19
|
+
gasLimit?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
}
|
|
22
|
+
interface BalancesResponse {
|
|
23
|
+
wallet: string;
|
|
24
|
+
avax: string;
|
|
25
|
+
arena: string;
|
|
26
|
+
avaxFormatted: string;
|
|
27
|
+
arenaFormatted: string;
|
|
28
|
+
}
|
|
29
|
+
interface BuyQuoteResponse {
|
|
30
|
+
avaxIn: string;
|
|
31
|
+
arenaOut: string;
|
|
32
|
+
arenaOutFormatted: string;
|
|
33
|
+
rate: string;
|
|
34
|
+
priceImpact: string;
|
|
35
|
+
}
|
|
36
|
+
interface SellQuoteResponse {
|
|
37
|
+
arenaIn: string;
|
|
38
|
+
avaxOut: string;
|
|
39
|
+
avaxOutFormatted: string;
|
|
40
|
+
rate: string;
|
|
41
|
+
priceImpact: string;
|
|
42
|
+
}
|
|
43
|
+
interface SwapBuyResponse {
|
|
44
|
+
transactions: UnsignedTx[];
|
|
45
|
+
summary: string;
|
|
46
|
+
}
|
|
47
|
+
interface SwapSellResponse {
|
|
48
|
+
transactions: UnsignedTx[];
|
|
49
|
+
}
|
|
50
|
+
interface StakeInfoResponse {
|
|
51
|
+
staked: string;
|
|
52
|
+
stakedFormatted: string;
|
|
53
|
+
rewards: string;
|
|
54
|
+
rewardsFormatted: string;
|
|
55
|
+
apy: string;
|
|
56
|
+
}
|
|
57
|
+
interface StakeBuildResponse {
|
|
58
|
+
transactions: UnsignedTx[];
|
|
59
|
+
}
|
|
60
|
+
interface TokenCreator {
|
|
61
|
+
address: string;
|
|
62
|
+
handle: string;
|
|
63
|
+
photoUrl: string;
|
|
64
|
+
twitterFollowers: number | null;
|
|
65
|
+
totalTokensCreated: number | null;
|
|
66
|
+
}
|
|
67
|
+
interface LaunchpadToken {
|
|
68
|
+
tokenId: string;
|
|
69
|
+
type: "AVAX-paired" | "ARENA-paired";
|
|
70
|
+
name: string;
|
|
71
|
+
symbol: string;
|
|
72
|
+
tokenAddress: string;
|
|
73
|
+
photoUrl: string;
|
|
74
|
+
description: string | null;
|
|
75
|
+
creator: TokenCreator;
|
|
76
|
+
price: {
|
|
77
|
+
eth: number;
|
|
78
|
+
usd: number;
|
|
79
|
+
avaxPrice: number;
|
|
80
|
+
};
|
|
81
|
+
volume: {
|
|
82
|
+
totalEth: number;
|
|
83
|
+
totalUsd: number;
|
|
84
|
+
};
|
|
85
|
+
holders: number;
|
|
86
|
+
transactions: number;
|
|
87
|
+
graduationProgress: string | null;
|
|
88
|
+
graduated: boolean;
|
|
89
|
+
supply: number;
|
|
90
|
+
createdAt: string | null;
|
|
91
|
+
whitelist: unknown;
|
|
92
|
+
isOfficial: boolean;
|
|
93
|
+
dexPoolId: string | null;
|
|
94
|
+
}
|
|
95
|
+
interface LaunchpadListResponse {
|
|
96
|
+
count: number;
|
|
97
|
+
tokens: LaunchpadToken[];
|
|
98
|
+
}
|
|
99
|
+
interface TokenStatsTimeframes {
|
|
100
|
+
"5m": number;
|
|
101
|
+
"1h": number;
|
|
102
|
+
"4h": number;
|
|
103
|
+
"12h": number;
|
|
104
|
+
"24h": number;
|
|
105
|
+
}
|
|
106
|
+
interface TokenDetailResponse extends LaunchpadToken {
|
|
107
|
+
stats?: {
|
|
108
|
+
buys: TokenStatsTimeframes;
|
|
109
|
+
sells: TokenStatsTimeframes;
|
|
110
|
+
uniqueBuyers: TokenStatsTimeframes;
|
|
111
|
+
uniqueSellers: TokenStatsTimeframes;
|
|
112
|
+
volume: TokenStatsTimeframes;
|
|
113
|
+
priceChange: TokenStatsTimeframes;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
interface LaunchpadQuoteResponse {
|
|
117
|
+
tokensOut?: string;
|
|
118
|
+
avaxCost?: string;
|
|
119
|
+
avaxOut?: string;
|
|
120
|
+
fees?: Record<string, string>;
|
|
121
|
+
}
|
|
122
|
+
interface TradeEntry {
|
|
123
|
+
type: "buy" | "sell";
|
|
124
|
+
trader: {
|
|
125
|
+
address: string;
|
|
126
|
+
handle: string;
|
|
127
|
+
name: string;
|
|
128
|
+
photoUrl: string;
|
|
129
|
+
twitterFollowers: number | null;
|
|
130
|
+
};
|
|
131
|
+
tokenAmount: number;
|
|
132
|
+
costOrReward?: {
|
|
133
|
+
eth: number;
|
|
134
|
+
usd: number;
|
|
135
|
+
};
|
|
136
|
+
value?: {
|
|
137
|
+
eth: number;
|
|
138
|
+
usd: number;
|
|
139
|
+
};
|
|
140
|
+
priceEth: number;
|
|
141
|
+
txHash: string;
|
|
142
|
+
time: string | null;
|
|
143
|
+
}
|
|
144
|
+
interface TokenActivityResponse {
|
|
145
|
+
tokenId: string | null;
|
|
146
|
+
tokenAddress: string;
|
|
147
|
+
trades: TradeEntry[];
|
|
148
|
+
}
|
|
149
|
+
interface HolderEntry {
|
|
150
|
+
rank: number;
|
|
151
|
+
address: string;
|
|
152
|
+
handle: string;
|
|
153
|
+
name: string;
|
|
154
|
+
photoUrl: string;
|
|
155
|
+
twitterFollowers: number | null;
|
|
156
|
+
balance: number;
|
|
157
|
+
unrealizedPnl: {
|
|
158
|
+
eth: number;
|
|
159
|
+
usd: number;
|
|
160
|
+
};
|
|
161
|
+
realizedPnl: {
|
|
162
|
+
eth: number;
|
|
163
|
+
usd: number;
|
|
164
|
+
};
|
|
165
|
+
buys: number;
|
|
166
|
+
sells: number;
|
|
167
|
+
}
|
|
168
|
+
interface TokenHoldersResponse {
|
|
169
|
+
tokenAddress: string;
|
|
170
|
+
holders: HolderEntry[];
|
|
171
|
+
}
|
|
172
|
+
interface GlobalTradeEntry extends TradeEntry {
|
|
173
|
+
token: {
|
|
174
|
+
name: string;
|
|
175
|
+
symbol: string;
|
|
176
|
+
address: string;
|
|
177
|
+
photoUrl: string;
|
|
178
|
+
tokenId: string;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
interface GlobalTradesResponse {
|
|
182
|
+
count: number;
|
|
183
|
+
offset: number;
|
|
184
|
+
trades: GlobalTradeEntry[];
|
|
185
|
+
}
|
|
186
|
+
interface LaunchpadBuyResponse {
|
|
187
|
+
transactions?: UnsignedTx[];
|
|
188
|
+
graduated?: boolean;
|
|
189
|
+
summary?: string;
|
|
190
|
+
note?: string;
|
|
191
|
+
}
|
|
192
|
+
interface LaunchpadSellResponse {
|
|
193
|
+
transactions: UnsignedTx[];
|
|
194
|
+
graduated?: boolean;
|
|
195
|
+
summary?: string;
|
|
196
|
+
note?: string;
|
|
197
|
+
}
|
|
198
|
+
interface DexTokenEntry {
|
|
199
|
+
symbol: string;
|
|
200
|
+
address: string;
|
|
201
|
+
decimals: number;
|
|
202
|
+
}
|
|
203
|
+
interface DexTokensResponse {
|
|
204
|
+
tokens: DexTokenEntry[];
|
|
205
|
+
note: string;
|
|
206
|
+
}
|
|
207
|
+
interface DexTokenInfoResponse {
|
|
208
|
+
address: string;
|
|
209
|
+
symbol: string;
|
|
210
|
+
name: string;
|
|
211
|
+
decimals: number;
|
|
212
|
+
}
|
|
213
|
+
interface DexQuoteResponse {
|
|
214
|
+
from: string;
|
|
215
|
+
to: string;
|
|
216
|
+
amountIn: string;
|
|
217
|
+
amountOut: string;
|
|
218
|
+
rate: string;
|
|
219
|
+
priceImpact: string;
|
|
220
|
+
path: string[];
|
|
221
|
+
}
|
|
222
|
+
interface DexBalanceResponse {
|
|
223
|
+
wallet: string;
|
|
224
|
+
token: string;
|
|
225
|
+
balance: string;
|
|
226
|
+
formatted: string;
|
|
227
|
+
symbol: string;
|
|
228
|
+
}
|
|
229
|
+
interface DexSwapResponse {
|
|
230
|
+
transactions: UnsignedTx[];
|
|
231
|
+
summary: string;
|
|
232
|
+
}
|
|
233
|
+
interface RegisterResponse {
|
|
234
|
+
apiKey: string;
|
|
235
|
+
wallet: string;
|
|
236
|
+
name: string;
|
|
237
|
+
}
|
|
238
|
+
interface BroadcastResponse {
|
|
239
|
+
txHash: string;
|
|
240
|
+
}
|
|
241
|
+
interface HealthResponse {
|
|
242
|
+
status: string;
|
|
243
|
+
router: string;
|
|
244
|
+
fee: string;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
declare class SwapModule {
|
|
248
|
+
private http;
|
|
249
|
+
private auth;
|
|
250
|
+
constructor(http: HttpClient, auth: () => Promise<void>);
|
|
251
|
+
/**
|
|
252
|
+
* Get AVAX and ARENA token balances for a wallet.
|
|
253
|
+
* @param wallet - Wallet address to check
|
|
254
|
+
*/
|
|
255
|
+
getBalances(wallet: string): Promise<BalancesResponse>;
|
|
256
|
+
/**
|
|
257
|
+
* Quote how much ARENA you get for a given amount of AVAX.
|
|
258
|
+
* @param avax - Amount of AVAX to spend
|
|
259
|
+
*/
|
|
260
|
+
quote(avax: string): Promise<BuyQuoteResponse>;
|
|
261
|
+
/**
|
|
262
|
+
* Quote how much AVAX you get for selling a given amount of ARENA.
|
|
263
|
+
* @param arena - Amount of ARENA to sell
|
|
264
|
+
*/
|
|
265
|
+
sellQuote(arena: string): Promise<SellQuoteResponse>;
|
|
266
|
+
/**
|
|
267
|
+
* Build unsigned transaction to buy ARENA with AVAX.
|
|
268
|
+
*
|
|
269
|
+
* Sign the transaction, then broadcast via `client.broadcast()`.
|
|
270
|
+
*
|
|
271
|
+
* @param wallet - Your wallet address
|
|
272
|
+
* @param avax - Amount of AVAX to spend
|
|
273
|
+
* @param slippage - Slippage tolerance in basis points (default: 500 = 5%)
|
|
274
|
+
*/
|
|
275
|
+
buildBuy(wallet: string, avax: string, slippage?: number): Promise<SwapBuyResponse>;
|
|
276
|
+
/**
|
|
277
|
+
* Build unsigned transactions to sell ARENA for AVAX.
|
|
278
|
+
*
|
|
279
|
+
* Returns 2 transactions — execute in order:
|
|
280
|
+
* 1. Approve — allows the DEX router to spend your ARENA
|
|
281
|
+
* 2. Swap — executes the ARENA → AVAX swap
|
|
282
|
+
*
|
|
283
|
+
* Sign each, broadcast via `client.broadcast()`, wait for confirmation before the next.
|
|
284
|
+
*
|
|
285
|
+
* @param wallet - Your wallet address
|
|
286
|
+
* @param amount - Amount of ARENA to sell, or "max" for entire balance
|
|
287
|
+
* @param slippage - Slippage tolerance in basis points (default: 500 = 5%)
|
|
288
|
+
*/
|
|
289
|
+
buildSell(wallet: string, amount: string, slippage?: number): Promise<SwapSellResponse>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
declare class StakingModule {
|
|
293
|
+
private http;
|
|
294
|
+
private auth;
|
|
295
|
+
constructor(http: HttpClient, auth: () => Promise<void>);
|
|
296
|
+
/**
|
|
297
|
+
* Get staking info for a wallet — staked amount, pending rewards, APY.
|
|
298
|
+
* @param wallet - Wallet address to check
|
|
299
|
+
*/
|
|
300
|
+
getInfo(wallet: string): Promise<StakeInfoResponse>;
|
|
301
|
+
/**
|
|
302
|
+
* Build unsigned transactions to stake ARENA tokens.
|
|
303
|
+
*
|
|
304
|
+
* Returns 2 transactions — execute in order:
|
|
305
|
+
* 1. Approve — allows the staking contract to spend your ARENA
|
|
306
|
+
* 2. Stake — deposits ARENA into staking
|
|
307
|
+
*
|
|
308
|
+
* @param wallet - Your wallet address
|
|
309
|
+
* @param amount - Amount of ARENA to stake
|
|
310
|
+
*/
|
|
311
|
+
buildStake(wallet: string, amount: string): Promise<StakeBuildResponse>;
|
|
312
|
+
/**
|
|
313
|
+
* Build unsigned transactions to buy ARENA with AVAX and stake in one flow.
|
|
314
|
+
*
|
|
315
|
+
* Combines swap + approve + stake. Returns multiple transactions — execute in order.
|
|
316
|
+
*
|
|
317
|
+
* @param wallet - Your wallet address
|
|
318
|
+
* @param avax - Amount of AVAX to spend
|
|
319
|
+
* @param slippage - Slippage tolerance in basis points (default: 500 = 5%)
|
|
320
|
+
*/
|
|
321
|
+
buildBuyAndStake(wallet: string, avax: string, slippage?: number): Promise<StakeBuildResponse>;
|
|
322
|
+
/**
|
|
323
|
+
* Build unsigned transaction to unstake ARENA tokens and claim rewards.
|
|
324
|
+
* @param wallet - Your wallet address
|
|
325
|
+
* @param amount - Amount of ARENA to unstake
|
|
326
|
+
*/
|
|
327
|
+
buildUnstake(wallet: string, amount: string): Promise<UnsignedTx>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
declare class LaunchpadModule {
|
|
331
|
+
private http;
|
|
332
|
+
private auth;
|
|
333
|
+
constructor(http: HttpClient, auth: () => Promise<void>);
|
|
334
|
+
/**
|
|
335
|
+
* Get recently launched tokens on Arena.
|
|
336
|
+
* @param count - Number of tokens (max 50, default 10)
|
|
337
|
+
* @param type - Filter: "all", "avax" (AVAX-paired), or "arena" (ARENA-paired)
|
|
338
|
+
*/
|
|
339
|
+
getRecent(count?: number, type?: "all" | "avax" | "arena"): Promise<LaunchpadListResponse>;
|
|
340
|
+
/**
|
|
341
|
+
* Search for a token by name, symbol, or contract address.
|
|
342
|
+
* @param q - Search query — name, symbol, or 0x contract address
|
|
343
|
+
*/
|
|
344
|
+
search(q: string): Promise<LaunchpadListResponse | LaunchpadToken>;
|
|
345
|
+
/**
|
|
346
|
+
* Get tokens that are closest to graduating from the bonding curve to DEX.
|
|
347
|
+
* @param count - Number of tokens (max 20, default 5)
|
|
348
|
+
*/
|
|
349
|
+
getGraduating(count?: number): Promise<LaunchpadListResponse>;
|
|
350
|
+
/**
|
|
351
|
+
* Get tokens that have already graduated from the bonding curve to DEX.
|
|
352
|
+
* @param count - Number of tokens (max 50, default 10)
|
|
353
|
+
*/
|
|
354
|
+
getGraduated(count?: number): Promise<LaunchpadListResponse>;
|
|
355
|
+
/**
|
|
356
|
+
* Get top tokens by trading volume.
|
|
357
|
+
* @param timeframe - "5m", "1h", "4h", "24h", or "all_time"
|
|
358
|
+
* @param count - Number of tokens (max 50, default 10)
|
|
359
|
+
*/
|
|
360
|
+
getTopVolume(timeframe?: "5m" | "1h" | "4h" | "24h" | "all_time", count?: number): Promise<LaunchpadListResponse & {
|
|
361
|
+
timeframe: string;
|
|
362
|
+
}>;
|
|
363
|
+
/**
|
|
364
|
+
* Get full token profile with stats — price, market cap, graduation progress, buy/sell activity.
|
|
365
|
+
* @param tokenId - Arena token ID
|
|
366
|
+
* @param address - Or token contract address (0x...)
|
|
367
|
+
*/
|
|
368
|
+
getToken(tokenId?: string, address?: string): Promise<TokenDetailResponse>;
|
|
369
|
+
/**
|
|
370
|
+
* Get a buy or sell quote for a bonding curve token.
|
|
371
|
+
* @param tokenId - Arena token ID
|
|
372
|
+
* @param side - "buy" or "sell"
|
|
373
|
+
* @param amount - For buy: AVAX amount. For sell: token amount.
|
|
374
|
+
*/
|
|
375
|
+
quote(tokenId: string, side: "buy" | "sell", amount: string): Promise<LaunchpadQuoteResponse>;
|
|
376
|
+
/**
|
|
377
|
+
* Get agent's tracked portfolio — all launchpad tokens the agent has bought.
|
|
378
|
+
* @param wallet - Agent wallet address
|
|
379
|
+
*/
|
|
380
|
+
getPortfolio(wallet: string): Promise<unknown>;
|
|
381
|
+
/**
|
|
382
|
+
* Get market cap data for a token.
|
|
383
|
+
* @param tokenId - Arena token ID
|
|
384
|
+
*/
|
|
385
|
+
getMarketCap(tokenId: string): Promise<unknown>;
|
|
386
|
+
/**
|
|
387
|
+
* Get recent trade activity for a token.
|
|
388
|
+
* @param tokenId - Arena token ID
|
|
389
|
+
* @param address - Or token contract address
|
|
390
|
+
* @param count - Number of trades (max 50, default 20)
|
|
391
|
+
*/
|
|
392
|
+
getActivity(tokenId?: string, address?: string, count?: number): Promise<TokenActivityResponse>;
|
|
393
|
+
/**
|
|
394
|
+
* Get top holders for a token with PnL data.
|
|
395
|
+
* @param address - Token contract address
|
|
396
|
+
* @param tokenId - Or Arena token ID
|
|
397
|
+
* @param count - Number of holders (max 50, default 20)
|
|
398
|
+
*/
|
|
399
|
+
getHolders(address?: string, tokenId?: string, count?: number): Promise<TokenHoldersResponse>;
|
|
400
|
+
/**
|
|
401
|
+
* Get platform overview — total tokens launched, contract addresses, stats.
|
|
402
|
+
*/
|
|
403
|
+
getOverview(): Promise<unknown>;
|
|
404
|
+
/**
|
|
405
|
+
* Get the global trade feed across all launchpad tokens.
|
|
406
|
+
* @param count - Number of trades (max 100, default 50)
|
|
407
|
+
* @param offset - Pagination offset
|
|
408
|
+
*/
|
|
409
|
+
getTrades(count?: number, offset?: number): Promise<GlobalTradesResponse>;
|
|
410
|
+
/**
|
|
411
|
+
* Build unsigned transaction to buy a launchpad token with AVAX.
|
|
412
|
+
*
|
|
413
|
+
* Auto-detects if the token is AVAX-paired or ARENA-paired and routes accordingly.
|
|
414
|
+
* If the token has graduated to DEX, returns transactions for DEX swap instead.
|
|
415
|
+
*
|
|
416
|
+
* @param wallet - Your wallet address
|
|
417
|
+
* @param tokenId - Arena token ID
|
|
418
|
+
* @param avax - Amount of AVAX to spend
|
|
419
|
+
* @param slippage - Slippage in basis points (default: 500 = 5%)
|
|
420
|
+
*/
|
|
421
|
+
buildBuy(wallet: string, tokenId: string, avax: string, slippage?: number): Promise<LaunchpadBuyResponse>;
|
|
422
|
+
/**
|
|
423
|
+
* Build unsigned transaction(s) to sell a launchpad token.
|
|
424
|
+
*
|
|
425
|
+
* Returns approve + sell transactions. Execute in order.
|
|
426
|
+
* Use amount="max" to sell entire balance.
|
|
427
|
+
*
|
|
428
|
+
* If the token has graduated to DEX, returns transactions for DEX swap instead.
|
|
429
|
+
*
|
|
430
|
+
* @param wallet - Your wallet address
|
|
431
|
+
* @param tokenId - Arena token ID
|
|
432
|
+
* @param amount - Token amount to sell, or "max" for entire balance
|
|
433
|
+
* @param slippage - Slippage in basis points (default: 500 = 5%)
|
|
434
|
+
*/
|
|
435
|
+
buildSell(wallet: string, tokenId: string, amount: string, slippage?: number): Promise<LaunchpadSellResponse>;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
declare class DexModule {
|
|
439
|
+
private http;
|
|
440
|
+
private auth;
|
|
441
|
+
constructor(http: HttpClient, auth: () => Promise<void>);
|
|
442
|
+
/**
|
|
443
|
+
* List all known tokens with addresses and decimals.
|
|
444
|
+
* You can also pass any contract address directly to other methods — not limited to this list.
|
|
445
|
+
*/
|
|
446
|
+
getTokens(): Promise<DexTokensResponse>;
|
|
447
|
+
/**
|
|
448
|
+
* Get on-chain info for any token by contract address — name, symbol, decimals.
|
|
449
|
+
* @param address - Token contract address (0x...)
|
|
450
|
+
*/
|
|
451
|
+
getTokenInfo(address: string): Promise<DexTokenInfoResponse>;
|
|
452
|
+
/**
|
|
453
|
+
* Quote a swap between any two tokens on Avalanche.
|
|
454
|
+
* @param from - Source token symbol or contract address
|
|
455
|
+
* @param to - Destination token symbol or contract address
|
|
456
|
+
* @param amount - Amount of source token to swap
|
|
457
|
+
*/
|
|
458
|
+
quote(from: string, to: string, amount: string): Promise<DexQuoteResponse>;
|
|
459
|
+
/**
|
|
460
|
+
* Get the balance of any token for a wallet.
|
|
461
|
+
* @param wallet - Wallet address
|
|
462
|
+
* @param token - Token symbol or contract address
|
|
463
|
+
*/
|
|
464
|
+
getBalance(wallet: string, token: string): Promise<DexBalanceResponse>;
|
|
465
|
+
/**
|
|
466
|
+
* Build unsigned transaction(s) to swap any token pair on Avalanche via LFJ/Pharaoh DEX.
|
|
467
|
+
*
|
|
468
|
+
* May return multiple transactions (approve + swap). Execute in order.
|
|
469
|
+
*
|
|
470
|
+
* @param wallet - Your wallet address
|
|
471
|
+
* @param from - Source token symbol or contract address
|
|
472
|
+
* @param to - Destination token symbol or contract address
|
|
473
|
+
* @param amount - Amount to swap, or "max" for entire balance
|
|
474
|
+
* @param slippage - Slippage tolerance in basis points (default: 500 = 5%)
|
|
475
|
+
*/
|
|
476
|
+
buildSwap(wallet: string, from: string, to: string, amount: string, slippage?: number): Promise<DexSwapResponse>;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
interface LogiqicalConfig {
|
|
480
|
+
/** Your wallet address — used for auto-registration */
|
|
481
|
+
wallet: string;
|
|
482
|
+
/** Existing API key (skips auto-registration if provided) */
|
|
483
|
+
apiKey?: string;
|
|
484
|
+
/** Custom base URL (defaults to Logiqical production API) */
|
|
485
|
+
baseUrl?: string;
|
|
486
|
+
/** Agent display name for registration */
|
|
487
|
+
name?: string;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Logiqical SDK client — the complete toolkit for AI agents trading on Avalanche.
|
|
491
|
+
*
|
|
492
|
+
* ```ts
|
|
493
|
+
* import { LogiqicalClient } from "logiqical";
|
|
494
|
+
*
|
|
495
|
+
* const client = new LogiqicalClient({ wallet: "0xYourWallet" });
|
|
496
|
+
*
|
|
497
|
+
* // Auto-registers on first call — no setup needed
|
|
498
|
+
* const balances = await client.swap.getBalances("0xYourWallet");
|
|
499
|
+
* const tokens = await client.launchpad.getRecent(10);
|
|
500
|
+
* const tx = await client.dex.buildSwap("0xWallet", "AVAX", "USDC", "1.0");
|
|
501
|
+
* ```
|
|
502
|
+
*/
|
|
503
|
+
declare class LogiqicalClient {
|
|
504
|
+
/** Buy/sell ARENA tokens via LFJ DEX */
|
|
505
|
+
readonly swap: SwapModule;
|
|
506
|
+
/** Stake ARENA tokens for rewards */
|
|
507
|
+
readonly staking: StakingModule;
|
|
508
|
+
/** Discover, research, and trade launchpad tokens on bonding curves */
|
|
509
|
+
readonly launchpad: LaunchpadModule;
|
|
510
|
+
/** Swap any Avalanche token via LFJ + Pharaoh DEX */
|
|
511
|
+
readonly dex: DexModule;
|
|
512
|
+
private http;
|
|
513
|
+
private wallet;
|
|
514
|
+
private agentName;
|
|
515
|
+
private registrationPromise;
|
|
516
|
+
constructor(config: LogiqicalConfig);
|
|
517
|
+
/** The API key (available after first call or if provided in config) */
|
|
518
|
+
get apiKey(): string | null;
|
|
519
|
+
/**
|
|
520
|
+
* Broadcast a signed transaction to the Avalanche network.
|
|
521
|
+
* @param signedTx - Signed transaction hex string
|
|
522
|
+
* @returns Transaction hash
|
|
523
|
+
*/
|
|
524
|
+
broadcast(signedTx: string): Promise<BroadcastResponse>;
|
|
525
|
+
/**
|
|
526
|
+
* Get the full agent instructions document — describes all available capabilities.
|
|
527
|
+
*/
|
|
528
|
+
getInstructions(): Promise<string>;
|
|
529
|
+
/**
|
|
530
|
+
* Check if the API is healthy and responsive.
|
|
531
|
+
*/
|
|
532
|
+
health(): Promise<HealthResponse>;
|
|
533
|
+
/**
|
|
534
|
+
* Manually register and get an API key.
|
|
535
|
+
* Usually not needed — the client auto-registers on first call.
|
|
536
|
+
*/
|
|
537
|
+
register(): Promise<RegisterResponse>;
|
|
538
|
+
private ensureRegistered;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/** Error returned by the Logiqical API */
|
|
542
|
+
declare class LogiqicalError extends Error {
|
|
543
|
+
readonly statusCode: number;
|
|
544
|
+
readonly endpoint: string;
|
|
545
|
+
constructor(message: string, statusCode: number, endpoint: string);
|
|
546
|
+
}
|
|
547
|
+
/** Authentication error — invalid or missing API key */
|
|
548
|
+
declare class LogiqicalAuthError extends LogiqicalError {
|
|
549
|
+
constructor(endpoint: string);
|
|
550
|
+
}
|
|
551
|
+
|
|
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 };
|