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/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;
|
|
@@ -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 };
|