shortx-sdk
v0.1.128
Published
SDK for interacting with the ShortX Protocol Solana contract
Maintainers
Readme
ShortX SDK
A TypeScript SDK for interacting with the ShortX Protocol Solana contract.
Installation
npm install shortx-sdkUsage
import { Connection } from '@solana/web3.js';
import { Wallet } from '@coral-xyz/anchor';
import ShortXClient from 'shortx-sdk';
// Initialize the client
const connection = new Connection('https://api.devnet.solana.com');
const wallet = new Wallet(/* your wallet */);
const client = new ShortXClient(connection, wallet);
// Use the client to interact with the protocol
// Example: Get all markets
const markets = await client.trade.getAllMarkets();Features
- Create and manage markets
- Place and manage orders
- View market data and order books
- Handle user trades and positions
API Documentation
Trade Methods
getAllMarkets(): Get all marketsgetMarketById(marketId): Get market by IDcreateMarket(args): Create a new marketopenOrder(args): Open a new ordercloseOrder(args): Close an existing ordersettleOrder(args): Settle an order
License
MIT
