logiqical 0.1.0 → 0.1.2
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 +185 -0
- package/dist/index.d.mts +316 -2
- package/dist/index.d.ts +316 -2
- package/dist/index.js +308 -1
- package/dist/index.mjs +306 -1
- package/package.json +14 -4
package/README.md
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# logiqical
|
|
2
|
+
|
|
3
|
+
The complete SDK for AI agents trading on Avalanche. Swaps, staking, launchpad, token launches, DEX — one package, zero config.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install logiqical
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { LogiqicalClient } from "logiqical";
|
|
15
|
+
|
|
16
|
+
const client = new LogiqicalClient({ wallet: "0xYourWallet" });
|
|
17
|
+
// Auto-registers API key on first call. No setup needed.
|
|
18
|
+
|
|
19
|
+
// Check balances
|
|
20
|
+
const bal = await client.swap.getBalances("0xYourWallet");
|
|
21
|
+
|
|
22
|
+
// Discover trending launchpad tokens
|
|
23
|
+
const hot = await client.launchpad.getTopVolume("24h");
|
|
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
|
+
|
|
31
|
+
// Swap any token pair
|
|
32
|
+
const tx = await client.dex.buildSwap(wallet, "AVAX", "USDC", "1.0");
|
|
33
|
+
|
|
34
|
+
// Sign & broadcast
|
|
35
|
+
await client.broadcast(signedTx);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Modules
|
|
39
|
+
|
|
40
|
+
### `client.swap` — ARENA Token Swaps
|
|
41
|
+
|
|
42
|
+
| Method | Description |
|
|
43
|
+
|--------|-------------|
|
|
44
|
+
| `getBalances(wallet)` | AVAX and ARENA balances |
|
|
45
|
+
| `quote(avax)` | Quote AVAX → ARENA |
|
|
46
|
+
| `sellQuote(arena)` | Quote ARENA → AVAX |
|
|
47
|
+
| `buildBuy(wallet, avax, slippage?)` | Build buy transaction |
|
|
48
|
+
| `buildSell(wallet, amount, slippage?)` | Build sell transaction (`"max"` for all) |
|
|
49
|
+
|
|
50
|
+
### `client.staking` — Stake ARENA for Rewards
|
|
51
|
+
|
|
52
|
+
| Method | Description |
|
|
53
|
+
|--------|-------------|
|
|
54
|
+
| `getInfo(wallet)` | Staked amount, pending rewards, APY |
|
|
55
|
+
| `buildStake(wallet, amount)` | Stake ARENA tokens |
|
|
56
|
+
| `buildBuyAndStake(wallet, avax, slippage?)` | Buy + stake in one flow |
|
|
57
|
+
| `buildUnstake(wallet, amount)` | Unstake and claim rewards |
|
|
58
|
+
|
|
59
|
+
### `client.launchpad` — Token Discovery, Trading & Launch
|
|
60
|
+
|
|
61
|
+
#### Discovery
|
|
62
|
+
| Method | Description |
|
|
63
|
+
|--------|-------------|
|
|
64
|
+
| `getRecent(count?, type?)` | Latest launched tokens |
|
|
65
|
+
| `getTopVolume(timeframe?, count?)` | Trending by volume (5m/1h/4h/24h) |
|
|
66
|
+
| `getGraduating(count?)` | Tokens about to graduate to DEX |
|
|
67
|
+
| `getGraduated(count?)` | Already graduated tokens |
|
|
68
|
+
| `search(query)` | Find by name, symbol, or address |
|
|
69
|
+
|
|
70
|
+
#### Intelligence
|
|
71
|
+
| Method | Description |
|
|
72
|
+
|--------|-------------|
|
|
73
|
+
| `getToken(tokenId?, address?)` | Full token profile + stats |
|
|
74
|
+
| `getHolders(address?, tokenId?, count?)` | Top holders with PnL |
|
|
75
|
+
| `getActivity(tokenId?, address?, count?)` | Recent trade history |
|
|
76
|
+
| `getTrades(count?, offset?)` | Global trade feed |
|
|
77
|
+
| `quote(tokenId, side, amount)` | Bonding curve quote |
|
|
78
|
+
| `getPortfolio(wallet)` | Your tracked positions |
|
|
79
|
+
| `getMarketCap(tokenId)` | Market cap breakdown |
|
|
80
|
+
| `getOverview()` | Platform stats |
|
|
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 |
|
|
94
|
+
|
|
95
|
+
### `client.dex` — Swap Any Avalanche Token
|
|
96
|
+
|
|
97
|
+
| Method | Description |
|
|
98
|
+
|--------|-------------|
|
|
99
|
+
| `getTokens()` | List 14+ known tokens |
|
|
100
|
+
| `getTokenInfo(address)` | On-chain token info |
|
|
101
|
+
| `quote(from, to, amount)` | Quote any pair |
|
|
102
|
+
| `getBalance(wallet, token)` | Any token balance |
|
|
103
|
+
| `buildSwap(wallet, from, to, amount, slippage?)` | Swap any pair |
|
|
104
|
+
|
|
105
|
+
### System
|
|
106
|
+
|
|
107
|
+
| Method | Description |
|
|
108
|
+
|--------|-------------|
|
|
109
|
+
| `client.broadcast(signedTx)` | Broadcast signed transaction |
|
|
110
|
+
| `client.health()` | API health check |
|
|
111
|
+
| `client.getInstructions()` | Full agent documentation |
|
|
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
|
+
|
|
146
|
+
## How It Works
|
|
147
|
+
|
|
148
|
+
1. **Install** — `npm install logiqical`
|
|
149
|
+
2. **Initialize** — pass your wallet address
|
|
150
|
+
3. **Trade** — the SDK auto-registers an API key, builds unsigned transactions, you sign and broadcast
|
|
151
|
+
|
|
152
|
+
All `build*` methods return unsigned transactions. Sign them with your private key, then call `client.broadcast(signedTx)`. If multiple transactions are returned (e.g. approve + swap), execute them **in order** and wait for each to confirm.
|
|
153
|
+
|
|
154
|
+
## Configuration
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
const client = new LogiqicalClient({
|
|
158
|
+
wallet: "0x...", // Required: your agent's wallet
|
|
159
|
+
apiKey: "arena_...", // Optional: skip auto-registration
|
|
160
|
+
baseUrl: "https://...", // Optional: custom API URL
|
|
161
|
+
name: "my-agent", // Optional: agent display name
|
|
162
|
+
});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Features
|
|
166
|
+
|
|
167
|
+
- **Zero config** — just pass a wallet address
|
|
168
|
+
- **Auto-registration** — API key created on first call
|
|
169
|
+
- **Full TypeScript** — every method and response is typed
|
|
170
|
+
- **JSDoc everywhere** — AI agents understand methods from hover info
|
|
171
|
+
- **Zero dependencies** — uses native `fetch` (Node 18+)
|
|
172
|
+
- **CJS + ESM** — works with `require()` and `import`
|
|
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
|
|
176
|
+
|
|
177
|
+
## Built on
|
|
178
|
+
|
|
179
|
+
- [Avalanche C-Chain](https://avax.network)
|
|
180
|
+
- [Arena](https://arena.social)
|
|
181
|
+
- [Arena DEX Router](https://snowtrace.io/address/0xDE9D7290959b6060860b983b32f2d65b2701EBC2)
|
|
182
|
+
|
|
183
|
+
## License
|
|
184
|
+
|
|
185
|
+
MIT
|
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;
|
|
@@ -230,6 +256,115 @@ interface DexSwapResponse {
|
|
|
230
256
|
transactions: UnsignedTx[];
|
|
231
257
|
summary: string;
|
|
232
258
|
}
|
|
259
|
+
interface PerpsSetupResponse {
|
|
260
|
+
success: boolean;
|
|
261
|
+
message: string;
|
|
262
|
+
}
|
|
263
|
+
interface PerpsTradingPair {
|
|
264
|
+
provider: string;
|
|
265
|
+
dex: string;
|
|
266
|
+
name: string;
|
|
267
|
+
symbol: string;
|
|
268
|
+
icon: string;
|
|
269
|
+
baseAssetId: number;
|
|
270
|
+
baseAsset: string;
|
|
271
|
+
quoteAsset: string;
|
|
272
|
+
sizePrecision: number;
|
|
273
|
+
pricePrecision: number;
|
|
274
|
+
maxLeverage: number;
|
|
275
|
+
isDelisted: boolean;
|
|
276
|
+
isOnlyIsolated: boolean;
|
|
277
|
+
marginMode: string;
|
|
278
|
+
}
|
|
279
|
+
interface PerpsTradingPairsResponse {
|
|
280
|
+
pairs: PerpsTradingPair[];
|
|
281
|
+
cachedAt: string;
|
|
282
|
+
count: number;
|
|
283
|
+
}
|
|
284
|
+
interface PerpsOrderResponse {
|
|
285
|
+
[key: string]: any;
|
|
286
|
+
}
|
|
287
|
+
interface PerpsPositionsResponse {
|
|
288
|
+
assetPositions?: any[];
|
|
289
|
+
marginSummary?: {
|
|
290
|
+
accountValue: string;
|
|
291
|
+
totalMarginUsed: string;
|
|
292
|
+
totalNtlPos: string;
|
|
293
|
+
totalRawUsd: string;
|
|
294
|
+
};
|
|
295
|
+
[key: string]: any;
|
|
296
|
+
}
|
|
297
|
+
interface BridgeTransaction {
|
|
298
|
+
to: string;
|
|
299
|
+
data: string;
|
|
300
|
+
value: string;
|
|
301
|
+
gasLimit?: string;
|
|
302
|
+
chainId: number;
|
|
303
|
+
}
|
|
304
|
+
interface BridgeQuoteResponse {
|
|
305
|
+
id: string;
|
|
306
|
+
fromChainId: number;
|
|
307
|
+
toChainId: number;
|
|
308
|
+
fromToken: string;
|
|
309
|
+
toToken: string;
|
|
310
|
+
fromAmount: string;
|
|
311
|
+
toAmount: string;
|
|
312
|
+
estimatedGas: string;
|
|
313
|
+
estimatedTime: number;
|
|
314
|
+
tool: string;
|
|
315
|
+
transaction?: BridgeTransaction;
|
|
316
|
+
}
|
|
317
|
+
interface BridgeRoutesResponse {
|
|
318
|
+
routes: BridgeQuoteResponse[];
|
|
319
|
+
count: number;
|
|
320
|
+
}
|
|
321
|
+
interface BridgeStatusResponse {
|
|
322
|
+
status: "NOT_FOUND" | "PENDING" | "DONE" | "FAILED";
|
|
323
|
+
substatus?: string;
|
|
324
|
+
receiving?: {
|
|
325
|
+
txHash: string;
|
|
326
|
+
amount: string;
|
|
327
|
+
token: string;
|
|
328
|
+
chainId: number;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
interface BridgeLiFiToken {
|
|
332
|
+
address: string;
|
|
333
|
+
symbol: string;
|
|
334
|
+
decimals: number;
|
|
335
|
+
name: string;
|
|
336
|
+
priceUSD?: string;
|
|
337
|
+
chainId: number;
|
|
338
|
+
}
|
|
339
|
+
interface BridgeLiFiChain {
|
|
340
|
+
id: number;
|
|
341
|
+
key: string;
|
|
342
|
+
name: string;
|
|
343
|
+
chainType: string;
|
|
344
|
+
nativeToken?: {
|
|
345
|
+
symbol: string;
|
|
346
|
+
decimals: number;
|
|
347
|
+
address: string;
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
interface BridgeTokensResponse {
|
|
351
|
+
tokens: Record<string, BridgeLiFiToken[]>;
|
|
352
|
+
}
|
|
353
|
+
interface BridgeTokenResponse extends BridgeLiFiToken {
|
|
354
|
+
}
|
|
355
|
+
interface BridgeChainsResponse {
|
|
356
|
+
chains: BridgeLiFiChain[];
|
|
357
|
+
count: number;
|
|
358
|
+
}
|
|
359
|
+
interface BridgeConnectionsResponse {
|
|
360
|
+
connections: any[];
|
|
361
|
+
}
|
|
362
|
+
interface BridgeInfoResponse {
|
|
363
|
+
chains: Record<string, number>;
|
|
364
|
+
usdc: Record<string, string>;
|
|
365
|
+
nativeToken: string;
|
|
366
|
+
tip: string;
|
|
367
|
+
}
|
|
233
368
|
interface RegisterResponse {
|
|
234
369
|
apiKey: string;
|
|
235
370
|
wallet: string;
|
|
@@ -407,6 +542,36 @@ declare class LaunchpadModule {
|
|
|
407
542
|
* @param offset - Pagination offset
|
|
408
543
|
*/
|
|
409
544
|
getTrades(count?: number, offset?: number): Promise<GlobalTradesResponse>;
|
|
545
|
+
/**
|
|
546
|
+
* Launch a new token on Arena — uploads image, creates community, and returns the unsigned createToken transaction.
|
|
547
|
+
*
|
|
548
|
+
* @param wallet - Creator wallet address
|
|
549
|
+
* @param name - Token name (also used as community name)
|
|
550
|
+
* @param symbol - Token ticker symbol
|
|
551
|
+
* @param imageBase64 - Token image as base64 string (optional)
|
|
552
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
553
|
+
* @param initialBuyAvax - AVAX amount for initial buy at creation (default: "0")
|
|
554
|
+
*/
|
|
555
|
+
launch(wallet: string, name: string, symbol: string, imageBase64?: string, paymentToken?: "avax" | "arena", initialBuyAvax?: string): Promise<LaunchTokenResponse>;
|
|
556
|
+
/**
|
|
557
|
+
* Upload a token image to Arena's CDN and get the hosted URL.
|
|
558
|
+
* Use this before launch() if you want to preview the image URL first.
|
|
559
|
+
*
|
|
560
|
+
* @param imageBase64 - Image as base64 string
|
|
561
|
+
* @param fileType - MIME type (default: "image/jpeg")
|
|
562
|
+
*/
|
|
563
|
+
uploadImage(imageBase64: string, fileType?: string): Promise<UploadImageResponse>;
|
|
564
|
+
/**
|
|
565
|
+
* Build only the createToken transaction (no image or community creation).
|
|
566
|
+
* Useful if you want to handle image upload and community creation separately.
|
|
567
|
+
*
|
|
568
|
+
* @param wallet - Creator wallet address
|
|
569
|
+
* @param name - Token name
|
|
570
|
+
* @param symbol - Token ticker symbol
|
|
571
|
+
* @param paymentToken - "avax" or "arena" (default: "arena")
|
|
572
|
+
* @param initialBuyAvax - AVAX for initial buy (default: "0")
|
|
573
|
+
*/
|
|
574
|
+
buildCreate(wallet: string, name: string, symbol: string, paymentToken?: "avax" | "arena", initialBuyAvax?: string): Promise<BuildCreateResponse>;
|
|
410
575
|
/**
|
|
411
576
|
* Build unsigned transaction to buy a launchpad token with AVAX.
|
|
412
577
|
*
|
|
@@ -476,6 +641,151 @@ declare class DexModule {
|
|
|
476
641
|
buildSwap(wallet: string, from: string, to: string, amount: string, slippage?: number): Promise<DexSwapResponse>;
|
|
477
642
|
}
|
|
478
643
|
|
|
644
|
+
declare class PerpsModule {
|
|
645
|
+
private http;
|
|
646
|
+
private auth;
|
|
647
|
+
constructor(http: HttpClient, auth: () => Promise<void>);
|
|
648
|
+
/**
|
|
649
|
+
* Link your Arena API key to enable perps trading.
|
|
650
|
+
* One-time setup — after this, all /perp endpoints work automatically.
|
|
651
|
+
* @param arenaApiKey - Your Arena API key (from arena.social)
|
|
652
|
+
*/
|
|
653
|
+
setup(arenaApiKey: string): Promise<PerpsSetupResponse>;
|
|
654
|
+
/** Register for perps trading on Hyperliquid */
|
|
655
|
+
register(): Promise<any>;
|
|
656
|
+
/** Check perps registration status */
|
|
657
|
+
getRegistrationStatus(): Promise<any>;
|
|
658
|
+
/** Get your Hyperliquid API wallet address */
|
|
659
|
+
getWalletAddress(): Promise<any>;
|
|
660
|
+
/** Check which auth steps are completed */
|
|
661
|
+
getAuthStatus(): Promise<any>;
|
|
662
|
+
/**
|
|
663
|
+
* Get EIP-712 payload for an auth step.
|
|
664
|
+
* @param step - Auth step: "accept-terms", "approve-agent", "set-referrer", "approve-builder-fee"
|
|
665
|
+
* @param body - Optional body (accept-terms requires mainWalletAddress)
|
|
666
|
+
*/
|
|
667
|
+
getAuthPayload(step: string, body?: any): Promise<any>;
|
|
668
|
+
/**
|
|
669
|
+
* Submit signed EIP-712 payload for an auth step.
|
|
670
|
+
* @param step - Auth step
|
|
671
|
+
* @param body - Signed payload with signature and metadata
|
|
672
|
+
*/
|
|
673
|
+
submitAuthSignature(step: string, body: any): Promise<any>;
|
|
674
|
+
/** Enable HIP-3 abstraction (automated, no signature needed) */
|
|
675
|
+
enableHip3(): Promise<any>;
|
|
676
|
+
/** Get all available perpetual trading pairs (250+ markets) */
|
|
677
|
+
getTradingPairs(): Promise<PerpsTradingPairsResponse>;
|
|
678
|
+
/**
|
|
679
|
+
* Update leverage for a market. Must be called before first order.
|
|
680
|
+
* @param symbol - Market symbol (e.g. "BTC", "ETH")
|
|
681
|
+
* @param leverage - Leverage multiplier (1-50 depending on market)
|
|
682
|
+
* @param leverageType - "cross" or "isolated"
|
|
683
|
+
*/
|
|
684
|
+
updateLeverage(symbol: string, leverage: number, leverageType?: "cross" | "isolated"): Promise<any>;
|
|
685
|
+
/**
|
|
686
|
+
* Place one or more perpetual orders.
|
|
687
|
+
* @param orders - Array of order objects (see docs for BaseOrderParams)
|
|
688
|
+
*/
|
|
689
|
+
placeOrder(orders: any[]): Promise<PerpsOrderResponse>;
|
|
690
|
+
/**
|
|
691
|
+
* Cancel one or more open orders.
|
|
692
|
+
* @param cancels - Array of { assetIndex, oid }
|
|
693
|
+
*/
|
|
694
|
+
cancelOrders(cancels: {
|
|
695
|
+
assetIndex: number;
|
|
696
|
+
oid: number;
|
|
697
|
+
}[]): Promise<any>;
|
|
698
|
+
/**
|
|
699
|
+
* Modify an existing order.
|
|
700
|
+
* @param oid - Order ID to modify
|
|
701
|
+
* @param order - New order parameters
|
|
702
|
+
*/
|
|
703
|
+
modifyOrder(oid: number, order: any): Promise<any>;
|
|
704
|
+
/**
|
|
705
|
+
* Close a position (convenience — creates reduce-only IOC with 10% slippage).
|
|
706
|
+
* @param symbol - Market symbol
|
|
707
|
+
* @param positionSide - "long" or "short"
|
|
708
|
+
* @param size - Position size to close
|
|
709
|
+
* @param currentPrice - Current market price
|
|
710
|
+
* @param closePercent - Percentage to close (default: 100)
|
|
711
|
+
*/
|
|
712
|
+
closePosition(symbol: string, positionSide: "long" | "short", size: number, currentPrice: number, closePercent?: number): Promise<any>;
|
|
713
|
+
/** Get open orders */
|
|
714
|
+
getOrders(): Promise<any>;
|
|
715
|
+
/** Get trade execution history */
|
|
716
|
+
getTradeExecutions(): Promise<any>;
|
|
717
|
+
/**
|
|
718
|
+
* Get positions and margin summary (queries Hyperliquid directly).
|
|
719
|
+
* @param wallet - Your Hyperliquid wallet address (from getWalletAddress)
|
|
720
|
+
*/
|
|
721
|
+
getPositions(wallet: string): Promise<PerpsPositionsResponse>;
|
|
722
|
+
/**
|
|
723
|
+
* Get open orders from Hyperliquid directly.
|
|
724
|
+
* @param wallet - Your Hyperliquid wallet address
|
|
725
|
+
*/
|
|
726
|
+
getOpenOrders(wallet: string): Promise<any>;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
declare class BridgeModule {
|
|
730
|
+
private http;
|
|
731
|
+
private auth;
|
|
732
|
+
constructor(http: HttpClient, auth: () => Promise<void>);
|
|
733
|
+
/**
|
|
734
|
+
* Get all supported chains for cross-chain bridging.
|
|
735
|
+
*/
|
|
736
|
+
getChains(): Promise<BridgeChainsResponse>;
|
|
737
|
+
/**
|
|
738
|
+
* Get tokens available on specified chains.
|
|
739
|
+
* @param chains - Comma-separated chain IDs (e.g. "43114,42161")
|
|
740
|
+
*/
|
|
741
|
+
getTokens(chains: string): Promise<BridgeTokensResponse>;
|
|
742
|
+
/**
|
|
743
|
+
* Get info for a specific token on a chain.
|
|
744
|
+
* @param chainId - Chain ID
|
|
745
|
+
* @param address - Token contract address
|
|
746
|
+
*/
|
|
747
|
+
getToken(chainId: number, address: string): Promise<BridgeTokenResponse>;
|
|
748
|
+
/**
|
|
749
|
+
* Get available bridge connections between two chains.
|
|
750
|
+
* @param fromChainId - Source chain ID
|
|
751
|
+
* @param toChainId - Destination chain ID
|
|
752
|
+
* @param fromToken - Optional source token address
|
|
753
|
+
* @param toToken - Optional destination token address
|
|
754
|
+
*/
|
|
755
|
+
getConnections(fromChainId: number, toChainId: number, fromToken?: string, toToken?: string): Promise<BridgeConnectionsResponse>;
|
|
756
|
+
/**
|
|
757
|
+
* Get a bridge quote with unsigned transaction data.
|
|
758
|
+
* The agent signs the returned tx on the source chain.
|
|
759
|
+
*
|
|
760
|
+
* @param fromChainId - Source chain ID
|
|
761
|
+
* @param toChainId - Destination chain ID
|
|
762
|
+
* @param fromToken - Source token address (use 0x0000...0000 for native tokens)
|
|
763
|
+
* @param toToken - Destination token address
|
|
764
|
+
* @param fromAmount - Human-readable amount (e.g. "0.1")
|
|
765
|
+
* @param fromAddress - Sender wallet address
|
|
766
|
+
* @param toAddress - Optional receiver address (defaults to fromAddress)
|
|
767
|
+
* @param slippage - Slippage tolerance as decimal (default 0.03 = 3%)
|
|
768
|
+
* @param fromDecimals - Token decimals (default 18)
|
|
769
|
+
*/
|
|
770
|
+
getQuote(fromChainId: number, toChainId: number, fromToken: string, toToken: string, fromAmount: string, fromAddress: string, toAddress?: string, slippage?: number, fromDecimals?: number): Promise<BridgeQuoteResponse>;
|
|
771
|
+
/**
|
|
772
|
+
* Get multiple bridge route options.
|
|
773
|
+
*/
|
|
774
|
+
getRoutes(fromChainId: number, toChainId: number, fromToken: string, toToken: string, fromAmount: string, fromAddress: string, toAddress?: string, slippage?: number, fromDecimals?: number): Promise<BridgeRoutesResponse>;
|
|
775
|
+
/**
|
|
776
|
+
* Check bridge transfer status.
|
|
777
|
+
* @param txHash - Source chain transaction hash
|
|
778
|
+
* @param fromChainId - Source chain ID
|
|
779
|
+
* @param toChainId - Destination chain ID
|
|
780
|
+
* @param bridge - Optional bridge tool name
|
|
781
|
+
*/
|
|
782
|
+
getStatus(txHash: string, fromChainId: number, toChainId: number, bridge?: string): Promise<BridgeStatusResponse>;
|
|
783
|
+
/**
|
|
784
|
+
* Get reference info — common chain IDs, USDC addresses, native token constant.
|
|
785
|
+
*/
|
|
786
|
+
getInfo(): Promise<BridgeInfoResponse>;
|
|
787
|
+
}
|
|
788
|
+
|
|
479
789
|
interface LogiqicalConfig {
|
|
480
790
|
/** Your wallet address — used for auto-registration */
|
|
481
791
|
wallet: string;
|
|
@@ -507,8 +817,12 @@ declare class LogiqicalClient {
|
|
|
507
817
|
readonly staking: StakingModule;
|
|
508
818
|
/** Discover, research, and trade launchpad tokens on bonding curves */
|
|
509
819
|
readonly launchpad: LaunchpadModule;
|
|
510
|
-
/** Swap any Avalanche token via LFJ +
|
|
820
|
+
/** Swap any Avalanche token via LFJ + Arena DEX */
|
|
511
821
|
readonly dex: DexModule;
|
|
822
|
+
/** Trade perpetual futures on Hyperliquid via Arena */
|
|
823
|
+
readonly perps: PerpsModule;
|
|
824
|
+
/** Cross-chain token bridging via Li.Fi — any token, any chain */
|
|
825
|
+
readonly bridge: BridgeModule;
|
|
512
826
|
private http;
|
|
513
827
|
private wallet;
|
|
514
828
|
private agentName;
|
|
@@ -549,4 +863,4 @@ declare class LogiqicalAuthError extends LogiqicalError {
|
|
|
549
863
|
constructor(endpoint: string);
|
|
550
864
|
}
|
|
551
865
|
|
|
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 };
|
|
866
|
+
export { type ArenaCommunity, type BalancesResponse, type BridgeChainsResponse, type BridgeConnectionsResponse, type BridgeInfoResponse, type BridgeLiFiChain, type BridgeLiFiToken, BridgeModule, type BridgeQuoteResponse, type BridgeRoutesResponse, type BridgeStatusResponse, type BridgeTokenResponse, type BridgeTokensResponse, type BridgeTransaction, 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, PerpsModule, type PerpsOrderResponse, type PerpsPositionsResponse, type PerpsSetupResponse, type PerpsTradingPair, type PerpsTradingPairsResponse, 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 };
|